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, { 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