style: Addressed style issues

This commit is contained in:
2026-04-28 08:08:23 -06:00
parent 0a21f10b04
commit 7965b970d9
4 changed files with 7 additions and 14 deletions
+2 -4
View File
@@ -20,10 +20,8 @@ pub fn read_single_key(valid_chars: &[char], default: char, prompt: &str) -> Res
KeyCode::Char('c') if modifiers.contains(KeyModifiers::CONTROL) => {
break Err(anyhow::anyhow!("Interrupted"));
}
KeyCode::Char(c) => {
if valid_chars.contains(&c) {
break Ok(c);
}
KeyCode::Char(c) if valid_chars.contains(&c) => {
break Ok(c);
// Invalid character, continue loop
}
KeyCode::Enter => {
+2 -2
View File
@@ -33,7 +33,7 @@ use fuzzy_matcher::{FuzzyMatcher, skim::SkimMatcherV2};
use is_terminal::IsTerminal;
use std::borrow::Cow;
use std::sync::LazyLock;
use std::{env, path::PathBuf, process};
use std::{cmp, env, path::PathBuf, process};
use unicode_segmentation::UnicodeSegmentation;
pub static CODE_BLOCK_RE: LazyLock<Regex> =
@@ -123,7 +123,7 @@ where
Some((v, score))
})
.collect();
list.sort_unstable_by(|a, b| b.1.cmp(&a.1));
list.sort_unstable_by_key(|b| cmp::Reverse(b.1));
list.into_iter().map(|(v, _)| v).collect()
}