Sort when only a single report is present

This commit is contained in:
traxys 2023-12-08 21:31:35 +01:00
parent 8417c4a8db
commit 06efebc17b

View file

@ -181,12 +181,14 @@ where
(Some(u), None) => { (Some(u), None) => {
return u return u
.into_iter() .into_iter()
.sorted_by_key(|(k, _)| *k)
.map(|(k, v)| [Some(text(k).into()), float_text(v), None, None]) .map(|(k, v)| [Some(text(k).into()), float_text(v), None, None])
.collect(); .collect();
} }
(None, Some(u)) => { (None, Some(u)) => {
return u return u
.into_iter() .into_iter()
.sorted_by_key(|(k, _)| *k)
.map(|(k, v)| [Some(text(k).into()), None, None, float_text(v)]) .map(|(k, v)| [Some(text(k).into()), None, None, float_text(v)])
.collect(); .collect();
} }