From 7bc91d3c6822c149ccc84bd0eef22f76830c273d Mon Sep 17 00:00:00 2001 From: Owen Brooks Date: Fri, 17 Jun 2022 17:43:50 +1000 Subject: [PATCH] Check for empty vector in vector Debug --- src/base/matrix.rs | 4 ++++ 1 file changed, 4 insertions(+) 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)?;