simplify option_vec_printer

This commit is contained in:
Simon Gardling 2022-03-24 18:16:33 -04:00
parent 484267c1a4
commit d97c149e1f

View File

@ -248,7 +248,8 @@ where
T: Clone,
{
let max_i: i32 = (data.len() as i32) - 1;
let output: String = data
"[".to_owned()
+ &data
.iter()
.enumerate()
.map(|(i, x)| {
@ -264,9 +265,8 @@ where
tmp
})
.collect::<Vec<String>>()
.concat();
format!("[{}]", output)
.concat()
+ "]"
}
// Returns a vector of length `max_i` starting at value `min_x` with resolution
// of `resolution`