First attempt at Display for Object::Vector
This commit is contained in:
parent
31c68034a8
commit
4d3366db84
1 changed files with 4 additions and 1 deletions
|
@ -90,7 +90,10 @@ impl fmt::Display for Object {
|
|||
|
||||
Object::Vector(ref vec) => {
|
||||
// TODO: Actually write the vector values.
|
||||
write!(f, "#(").and_then(|_| write!(f, ")"))
|
||||
vec.iter().enumerate().fold(write!(f, "#("), |acc, (i, obj)| {
|
||||
let space = if i == (vec.len() - 1) { " " } else { "" };
|
||||
acc.and(write!(f, "{}{}", obj, space))
|
||||
}).and(write!(f, ")"))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue