aboutsummaryrefslogtreecommitdiff
path: root/libmu/src/maths/vector.rs
diff options
context:
space:
mode:
Diffstat (limited to 'libmu/src/maths/vector.rs')
-rw-r--r--libmu/src/maths/vector.rs17
1 files changed, 8 insertions, 9 deletions
diff --git a/libmu/src/maths/vector.rs b/libmu/src/maths/vector.rs
index c97b415..0c13e4c 100644
--- a/libmu/src/maths/vector.rs
+++ b/libmu/src/maths/vector.rs
@@ -362,14 +362,13 @@ impl<T: Float + fmt::Display> fmt::Display for RowVector<T> {
impl<T: Float + fmt::Display> fmt::Display for ColumnVector<T> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
- write!(
- f,
- "[{}]",
- self.0
- .iter()
- .map(|x| x.to_string())
- .collect::<Vec<String>>()
- .join(", ")
- )
+ write!(f, "[")?;
+ for (i, x) in self.0.iter().enumerate() {
+ if i > 0 {
+ write!(f, ",\n ")?;
+ }
+ write!(f, "{}", x)?;
+ }
+ write!(f, "]")
}
}