diff options
| author | Yotam Ofek <yotam.ofek@gmail.com> | 2025-01-21 13:43:55 +0000 |
|---|---|---|
| committer | Yotam Ofek <yotam.ofek@gmail.com> | 2025-01-21 13:44:53 +0000 |
| commit | efabee2dee498093a701ac0f721b76f8a834b50f (patch) | |
| tree | fa645e9cba6492c418c0fd5c5d9b5b0f49c45761 /compiler/rustc_resolve/src | |
| parent | 6f22dfe4df43e3f9be87e9debcc6a430715d7b02 (diff) | |
| download | rust-efabee2dee498093a701ac0f721b76f8a834b50f.tar.gz rust-efabee2dee498093a701ac0f721b76f8a834b50f.zip | |
rustc_resolve: don't open-code `Option::filter`
Diffstat (limited to 'compiler/rustc_resolve/src')
| -rw-r--r-- | compiler/rustc_resolve/src/diagnostics.rs | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/compiler/rustc_resolve/src/diagnostics.rs b/compiler/rustc_resolve/src/diagnostics.rs index 01496a6aec5..43e4e4d591f 100644 --- a/compiler/rustc_resolve/src/diagnostics.rs +++ b/compiler/rustc_resolve/src/diagnostics.rs @@ -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( |
