chore: cleanup

This commit is contained in:
iff 2024-11-17 15:06:14 +01:00
parent f1f7ed8dbe
commit 171b3d4607
5 changed files with 26 additions and 23 deletions

View file

@ -167,7 +167,7 @@ pub fn suggest_typo(typos: &[String], candidates: Vec<String>) -> String {
suggestions.join(" ")
}
pub fn find_similar(typo: &str, candidates: &Vec<String>) -> Option<String> {
pub fn find_similar(typo: &str, candidates: &[String]) -> Option<String> {
let mut min_distance = 10;
let mut min_distance_index = None;
for (i, candidate) in candidates.iter().enumerate() {