about summary refs log tree commit diff
path: root/compiler/rustc_resolve/src/check_unused.rs
diff options
context:
space:
mode:
authorJubilee Young <workingjubilee@gmail.com>2024-10-16 23:32:21 -0700
committerJubilee Young <workingjubilee@gmail.com>2024-10-16 23:50:13 -0700
commit47cfaa6d870d99f1441a96d90a55695a364e165a (patch)
treea932e92c406d0f580eb7dc440fd5fc14854fed36 /compiler/rustc_resolve/src/check_unused.rs
parentdd5127615ad626741a1116d022cf784637ac05df (diff)
downloadrust-47cfaa6d870d99f1441a96d90a55695a364e165a.tar.gz
rust-47cfaa6d870d99f1441a96d90a55695a364e165a.zip
compiler: use `is_none_or` where it is clearly better
heuristic was: if it easily allows removing bangs entirely? worth it.
if it requires more effort or just moves the bang? not.
Diffstat (limited to 'compiler/rustc_resolve/src/check_unused.rs')
-rw-r--r--compiler/rustc_resolve/src/check_unused.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_resolve/src/check_unused.rs b/compiler/rustc_resolve/src/check_unused.rs
index 3080a0c9892..e36055e8575 100644
--- a/compiler/rustc_resolve/src/check_unused.rs
+++ b/compiler/rustc_resolve/src/check_unused.rs
@@ -184,11 +184,11 @@ impl<'a, 'ra, 'tcx> UnusedImportCheckVisitor<'a, 'ra, 'tcx> {
 
             // If the extern crate isn't in the extern prelude,
             // there is no way it can be written as a `use`.
-            if !self
+            if self
                 .r
                 .extern_prelude
                 .get(&extern_crate.ident)
-                .is_some_and(|entry| !entry.introduced_by_item)
+                .is_none_or(|entry| entry.introduced_by_item)
             {
                 continue;
             }