Skip to content

Commit 651c7f8

Browse files
committed
Fix ordering of NLL dashboard
Fixes rust-lang#273.
1 parent 8922c73 commit 651c7f8

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

site/src/api.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,9 +173,9 @@ pub mod nll_dashboard {
173173
}
174174

175175
impl Point {
176-
pub fn pct(&self) -> Option<u64> {
176+
pub fn pct(&self) -> Option<f32> {
177177
if let (Some(clean), Some(nll)) = (self.clean, self.nll) {
178-
Some((100.0 * nll / clean) as u64)
178+
Some(100.0 * nll / clean)
179179
} else {
180180
None
181181
}

site/src/server.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,9 @@ pub fn handle_nll_dashboard(
125125
}).collect::<Vec<_>>();
126126
points.sort_by(|a, b| {
127127
match (a.pct(), b.pct()) {
128-
(Some(a), Some(b)) => a.cmp(&b).reverse(),
128+
(Some(a), Some(b)) => a.partial_cmp(&b).unwrap_or(Ordering::Equal).reverse(),
129129
(Some(_), None) => Ordering::Less,
130+
(None, Some(_)) => Ordering::Greater,
130131
_ => a.case.cmp(&b.case),
131132
}
132133
});

0 commit comments

Comments
 (0)