diff --git a/src/base/matrix.rs b/src/base/matrix.rs index 77e26925..fcdfa2d6 100644 --- a/src/base/matrix.rs +++ b/src/base/matrix.rs @@ -1986,6 +1986,10 @@ pub fn format_column_vec_as_row( where DefaultAllocator: Allocator, { + if vector.is_empty() { + return write!(f, "[ ]"); + } + write!(f, "[")?; let mut it = vector.iter(); std::fmt::Display::fmt(it.next().unwrap(), f)?;