From 21f105e65e7a8c0401f94a1f34e5ea60914ecec1 Mon Sep 17 00:00:00 2001 From: jenya Date: Wed, 30 Sep 2026 17:06:28 +0300 Subject: [PATCH] Fix clippy on Rust 1.98: sort_by_key, total_cmp instead of partial_cmp().unwrap() --- src/sparse/entry.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sparse/entry.rs b/src/sparse/entry.rs index 45d0bae..d252de4 100644 --- a/src/sparse/entry.rs +++ b/src/sparse/entry.rs @@ -61,11 +61,11 @@ impl CSCEntriesSort { } pub fn sort_entries_by_index(entries: &mut [Entry]) { - entries.sort_by(|a, b| a.index.cmp(&b.index)); + entries.sort_by_key(|e| e.index); } pub fn sort_entries_by_value(entries: &mut [Entry]) { - entries.sort_by(|a, b| a.value.partial_cmp(&b.value).unwrap()); + entries.sort_by(|a, b| a.value.total_cmp(&b.value)); } #[cfg(test)]