Display carts sorted

This commit is contained in:
Erin 2021-08-28 23:52:58 +02:00 committed by ondra05
parent 2010b13168
commit 1b243d142c

View file

@ -427,8 +427,10 @@ impl Display for Value {
},
Value::Cart(c) => {
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)?;
}