diff options
| author | Dániel Buga <bugadani@gmail.com> | 2020-10-16 12:49:25 +0200 |
|---|---|---|
| committer | Dániel Buga <bugadani@gmail.com> | 2020-10-18 11:01:08 +0200 |
| commit | d708d7fb7922215310396d29b00ae4bfcb992a0f (patch) | |
| tree | 0d4ba4205e8c74234ea6990acb9a0bf6c679b6b2 | |
| parent | ed7c6819e48d93636d0c0526a0f01a7b21ed2fe1 (diff) | |
| download | rust-d708d7fb7922215310396d29b00ae4bfcb992a0f.tar.gz rust-d708d7fb7922215310396d29b00ae4bfcb992a0f.zip | |
No need to map the max_distance
| -rw-r--r-- | compiler/rustc_ast/src/util/lev_distance.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_ast/src/util/lev_distance.rs b/compiler/rustc_ast/src/util/lev_distance.rs index 754b1f13381..21c2c925bc4 100644 --- a/compiler/rustc_ast/src/util/lev_distance.rs +++ b/compiler/rustc_ast/src/util/lev_distance.rs @@ -54,7 +54,7 @@ where T: Iterator<Item = &'a Symbol>, { let lookup = &lookup.as_str(); - let max_dist = dist.map_or_else(|| cmp::max(lookup.len(), 3) / 3, |d| d); + let max_dist = dist.unwrap_or_else(|| cmp::max(lookup.len(), 3) / 3); let name_vec: Vec<&Symbol> = iter_names.collect(); let (case_insensitive_match, levenshtein_match) = name_vec |
