Check namespace before computing the Levenshtein distance
This commit is contained in:
parent
f93bd000a3
commit
380d53fb2c
1 changed files with 4 additions and 1 deletions
|
@ -1904,8 +1904,11 @@ impl<'a, 'tcx> ProbeContext<'a, 'tcx> {
|
|||
.associated_items(def_id)
|
||||
.in_definition_order()
|
||||
.filter(|x| {
|
||||
if x.kind.namespace() != Namespace::ValueNS {
|
||||
return false;
|
||||
}
|
||||
let dist = lev_distance(name.as_str(), x.name.as_str());
|
||||
x.kind.namespace() == Namespace::ValueNS && dist > 0 && dist <= max_dist
|
||||
dist > 0 && dist <= max_dist
|
||||
})
|
||||
.copied()
|
||||
.collect()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue