From 5cf2734649a1f897f9d589c9a1b89db3a747f0e5 Mon Sep 17 00:00:00 2001 From: Leonard Hecker Date: Mon, 26 Jan 2026 23:23:41 +0100 Subject: [PATCH] Fix the latest clippy warning --- crates/edit/src/bin/edit/draw_statusbar.rs | 2 +- crates/edit/src/icu.rs | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/crates/edit/src/bin/edit/draw_statusbar.rs b/crates/edit/src/bin/edit/draw_statusbar.rs index 935e158e176..10e7ddbcfe1 100644 --- a/crates/edit/src/bin/edit/draw_statusbar.rs +++ b/crates/edit/src/bin/edit/draw_statusbar.rs @@ -302,7 +302,7 @@ fn encoding_picker_update_list(state: &mut State) { } } - matches.sort_unstable_by(|a, b| b.0.cmp(&a.0)); + matches.sort_unstable_by_key(|b| std::cmp::Reverse(b.0)); state.encoding_picker_results = Some(Vec::from_iter(matches.iter().map(|(_, enc)| *enc))); } diff --git a/crates/edit/src/icu.rs b/crates/edit/src/icu.rs index 8b8f783eeee..a99acac7cc6 100644 --- a/crates/edit/src/icu.rs +++ b/crates/edit/src/icu.rs @@ -534,11 +534,7 @@ fn utext_access_impl<'a>( } } - loop { - let Some(c) = it.next() else { - break; - }; - + while let Some(c) = it.next() { // Thanks to our `if utf16_len >= UTF16_LEN_LIMIT` check, // we can safely assume that this will fit. unsafe {