forked from AbleScript/ablescript
Avoid trailing comma in cart printout
This commit is contained in:
parent
711b8e1c03
commit
6cd2b8bd44
|
@ -532,8 +532,14 @@ impl Display for Value {
|
||||||
let mut cart_vec = c.iter().collect::<Vec<_>>();
|
let mut cart_vec = c.iter().collect::<Vec<_>>();
|
||||||
cart_vec.sort_by(|x, y| x.0.partial_cmp(y.0).unwrap_or(std::cmp::Ordering::Less));
|
cart_vec.sort_by(|x, y| x.0.partial_cmp(y.0).unwrap_or(std::cmp::Ordering::Less));
|
||||||
|
|
||||||
for (key, value) in cart_vec {
|
for (idx, (key, value)) in cart_vec.into_iter().enumerate() {
|
||||||
write!(f, "{} <= {}, ", value.borrow(), key)?;
|
write!(
|
||||||
|
f,
|
||||||
|
"{}{} <= {}",
|
||||||
|
if idx != 0 { ", " } else { "" },
|
||||||
|
value.borrow(),
|
||||||
|
key
|
||||||
|
)?;
|
||||||
}
|
}
|
||||||
|
|
||||||
write!(f, "]")
|
write!(f, "]")
|
||||||
|
|
Loading…
Reference in a new issue