Skip to content

Commit efabee2

Browse files
committed
rustc_resolve: don't open-code Option::filter
1 parent 6f22dfe commit efabee2

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

compiler/rustc_resolve/src/diagnostics.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -1976,10 +1976,7 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
19761976
.collect::<Vec<_>>();
19771977
candidates.sort();
19781978
candidates.dedup();
1979-
match find_best_match_for_name(&candidates, ident, None) {
1980-
Some(sugg) if sugg == ident => None,
1981-
sugg => sugg,
1982-
}
1979+
find_best_match_for_name(&candidates, ident, None).filter(|sugg| *sugg != ident)
19831980
}
19841981

19851982
pub(crate) fn report_path_resolution_error(

0 commit comments

Comments
 (0)