diff options
| author | Christian Stefanescu <chris@0chris.com> | 2020-08-21 14:03:42 +0200 |
|---|---|---|
| committer | Christian Stefanescu <chris@0chris.com> | 2020-08-22 14:22:02 +0200 |
| commit | e615a26ae4fe293cda83961470907e78e4b2ee75 (patch) | |
| tree | f34783d02fddd0d77cc53fcd1592dce18d664745 | |
| parent | 53508aeb65963c389233c956105202466128a900 (diff) | |
| download | rust-e615a26ae4fe293cda83961470907e78e4b2ee75.tar.gz rust-e615a26ae4fe293cda83961470907e78e4b2ee75.zip | |
Use more elegant way to check for prelude string
| -rw-r--r-- | clippy_lints/src/wildcard_imports.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clippy_lints/src/wildcard_imports.rs b/clippy_lints/src/wildcard_imports.rs index 717741129a8..5683a71efea 100644 --- a/clippy_lints/src/wildcard_imports.rs +++ b/clippy_lints/src/wildcard_imports.rs @@ -198,7 +198,7 @@ impl WildcardImports { // Allow "...prelude::..::*" imports. // Many crates have a prelude, and it is imported as a glob by design. fn is_prelude_import(segments: &[PathSegment<'_>]) -> bool { - segments.iter().filter(|ps| ps.ident.as_str() == "prelude").count() > 0 + segments.iter().any(|ps| ps.ident.as_str() == "prelude") } // Allow "super::*" imports in tests. |
