Skip to content

Commit

Permalink
rustc_resolve: don't open-code Option::filter
Browse files Browse the repository at this point in the history
  • Loading branch information
yotamofek committed Jan 21, 2025
1 parent 6f22dfe commit efabee2
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions compiler/rustc_resolve/src/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1976,10 +1976,7 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
.collect::<Vec<_>>();
candidates.sort();
candidates.dedup();
match find_best_match_for_name(&candidates, ident, None) {
Some(sugg) if sugg == ident => None,
sugg => sugg,
}
find_best_match_for_name(&candidates, ident, None).filter(|sugg| *sugg != ident)
}

pub(crate) fn report_path_resolution_error(
Expand Down

0 comments on commit efabee2

Please sign in to comment.