From a255d96aed5344e0ebb294eb95a44afc808d2d63 Mon Sep 17 00:00:00 2001 From: Daniel Eades Date: Wed, 23 Jun 2021 11:30:28 +0100 Subject: [PATCH] remove unnecessary 'collect' --- src/cargo/core/features.rs | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/cargo/core/features.rs b/src/cargo/core/features.rs index 057651aa2..6342d5d57 100644 --- a/src/cargo/core/features.rs +++ b/src/cargo/core/features.rs @@ -841,16 +841,13 @@ impl CliUnstable { // some point, and migrate to a new -Z flag for any future // things. let feats = parse_features(v); - let stab: Vec<_> = feats - .iter() - .filter(|feat| { - matches!( - feat.as_str(), - "build_dep" | "host_dep" | "dev_dep" | "itarget" | "all" - ) - }) - .collect(); - if !stab.is_empty() || feats.is_empty() { + let stab_is_empty = feats.iter().any(|feat| { + matches!( + feat.as_str(), + "build_dep" | "host_dep" | "dev_dep" | "itarget" | "all" + ) + }); + if !stab_is_empty || feats.is_empty() { // Make this stabilized_err once -Zfeature support is removed. stabilized_warn(k, "1.51", STABILIZED_FEATURES); } -- 2.39.5