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 {