Skip to content

Commit

Permalink
missed tidy check
Browse files Browse the repository at this point in the history
  • Loading branch information
cjkenn committed Jan 4, 2020
1 parent 91334e0 commit 27ea4c8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/libsyntax/util/lev_distance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ where
let max_dist = dist.map_or_else(|| cmp::max(lookup.len(), 3) / 3, |d| d);
let name_vec: Vec<&Symbol> = iter_names.collect();

let (case_insensitive_match, levenshtein_match) = name_vec.iter()
let (case_insensitive_match, levenshtein_match) = name_vec
.iter()
.filter_map(|&name| {
let dist = lev_distance(lookup, &name.as_str());
if dist <= max_dist { Some((name, dist)) } else { None }
Expand All @@ -74,7 +75,6 @@ where
},
)
});

// Priority of matches:
// 1. Exact case insensitive match
// 2. Levenshtein distance match
Expand Down

0 comments on commit 27ea4c8

Please sign in to comment.