]> git.lizzy.rs Git - rust.git/commitdiff
use all instead of join
authorkyoto7250 <50972773+kyoto7250@users.noreply.github.com>
Sun, 26 Jun 2022 07:11:04 +0000 (16:11 +0900)
committerkyoto7250 <50972773+kyoto7250@users.noreply.github.com>
Sun, 26 Jun 2022 07:11:04 +0000 (16:11 +0900)
clippy_lints/src/enum_variants.rs

index 99d5da2c2cc3a4c75c0f7ef491b2c92cae7c221d..cd36f9fcd729e170868ecf5f12e7af30e1c16305 100644 (file)
@@ -214,7 +214,7 @@ fn check_variant(cx: &LateContext<'_>, threshold: u64, def: &EnumDef<'_>, item_n
 
 #[must_use]
 fn have_no_extra_prefix(prefixes: &[&str]) -> bool {
-    prefixes.is_empty() || prefixes.join("") == "_"
+    prefixes.iter().all(|p| p == &"" || p == &"_")
 }
 
 #[must_use]