Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit d708d7f

Browse files
committed
No need to map the max_distance
1 parent ed7c681 commit d708d7f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler/rustc_ast/src/util/lev_distance.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ where
5454
T: Iterator<Item = &'a Symbol>,
5555
{
5656
let lookup = &lookup.as_str();
57-
let max_dist = dist.map_or_else(|| cmp::max(lookup.len(), 3) / 3, |d| d);
57+
let max_dist = dist.unwrap_or_else(|| cmp::max(lookup.len(), 3) / 3);
5858
let name_vec: Vec<&Symbol> = iter_names.collect();
5959

6060
let (case_insensitive_match, levenshtein_match) = name_vec

0 commit comments

Comments
 (0)