Display carts sorted
This commit is contained in:
parent
4c74e3bef3
commit
e8f08a90d5
|
@ -427,9 +427,11 @@ impl Display for Value {
|
||||||
},
|
},
|
||||||
Value::Cart(c) => {
|
Value::Cart(c) => {
|
||||||
write!(f, "[")?;
|
write!(f, "[")?;
|
||||||
|
let mut cart_vec = c.into_iter().collect::<Vec<_>>();
|
||||||
|
cart_vec.sort_by(|x, y| x.0.partial_cmp(&y.0).unwrap_or(std::cmp::Ordering::Less));
|
||||||
|
|
||||||
for (key, value) in c {
|
for (key, value) in cart_vec {
|
||||||
write!(f, "{} <= {},", value.borrow(), key)?;
|
write!(f, "{} <= {}, ", value.borrow(), key)?;
|
||||||
}
|
}
|
||||||
|
|
||||||
write!(f, "]")
|
write!(f, "]")
|
||||||
|
|
Loading…
Reference in a new issue