utils!: consistent function name

This commit is contained in:
iff 2024-12-09 16:27:39 +01:00
parent a136a2f5d1
commit ab557e9b86
4 changed files with 6 additions and 6 deletions

View file

@ -83,7 +83,7 @@ pub fn suggest_typo(typos: &[String], candidates: Vec<String>, executables: &[St
}
}
"file" => {
if let Some(suggest) = get_best_match_file(typo) {
if let Some(suggest) = best_match_file(typo) {
suggestions.push(suggest);
} else {
suggestions.push(typo.to_string());

View file

@ -44,10 +44,10 @@ pub fn get_path_files() -> Vec<String> {
all_executable
}
pub fn get_best_match_file(input: &str) -> Option<String> {
pub fn best_match_file(input: &str) -> Option<String> {
let mut input = input.trim_matches(|c| c == '\'' || c == '"').to_owned();
if cfg!(debug_assertions) {
eprintln!("get_best_match_file input: {input}");
eprintln!("best_match_file input: {input}");
}
let mut exit_dirs = Vec::new();
let mut files = loop {