Skip to content

Commit f67e19b

Browse files
committed
fix(gui): condense sorting logic in header
1 parent 7730fe3 commit f67e19b

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

nmrs-gui/src/ui/header.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ pub async fn refresh_networks(
339339
(None, None)
340340
};
341341

342-
nets.sort_by(|a, b| b.strength.unwrap_or(0).cmp(&a.strength.unwrap_or(0)));
342+
nets.sort_by_key(|b| std::cmp::Reverse(b.strength.unwrap_or(0)));
343343

344344
let mut seen_combinations = HashSet::new();
345345
nets.retain(|net| {
@@ -473,7 +473,7 @@ pub async fn refresh_networks_no_scan(
473473
(None, None)
474474
};
475475

476-
nets.sort_by(|a, b| b.strength.unwrap_or(0).cmp(&a.strength.unwrap_or(0)));
476+
nets.sort_by_key(|b| std::cmp::Reverse(b.strength.unwrap_or(0)));
477477

478478
let mut seen_combinations = HashSet::new();
479479
nets.retain(|net| {

0 commit comments

Comments
 (0)