We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
to_uppercase
1 parent d502eda commit f93bd00Copy full SHA for f93bd00
compiler/rustc_span/src/lev_distance.rs
@@ -56,14 +56,15 @@ pub fn find_best_match_for_name(
56
dist: Option<usize>,
57
) -> Option<Symbol> {
58
let lookup = lookup.as_str();
59
+ let lookup_uppercase = lookup.to_uppercase();
60
let max_dist = dist.unwrap_or_else(|| cmp::max(lookup.len(), 3) / 3);
61
62
// Priority of matches:
63
// 1. Exact case insensitive match
64
// 2. Levenshtein distance match
65
// 3. Sorted word match
66
if let Some(case_insensitive_match) =
- name_vec.iter().find(|candidate| candidate.as_str().to_uppercase() == lookup.to_uppercase())
67
+ name_vec.iter().find(|candidate| candidate.as_str().to_uppercase() == lookup_uppercase)
68
{
69
return Some(*case_insensitive_match);
70
}
0 commit comments