diff --git a/src/main.rs b/src/main.rs index 91872940..108b5570 100644 --- a/src/main.rs +++ b/src/main.rs @@ -336,16 +336,19 @@ impl From for cargo_semver_checks::Check { check.with_heuristically_included_features(); } let mut mutual_features = value.features; - // Treat --features="" as a no-op like cargo does - if mutual_features == [""] { - mutual_features.clear(); - } let mut current_features = value.current_features; let mut baseline_features = value.baseline_features; current_features.append(&mut mutual_features.clone()); baseline_features.append(&mut mutual_features); - check.with_extra_features(current_features, baseline_features); + // Treat --features="" as a no-op like cargo does + let trim_features = |features: &mut Vec| { + features.retain(|feature| !feature.is_empty()); + }; + trim_features(&mut current_features); + trim_features(&mut baseline_features); + + check.with_extra_features(current_features, baseline_features); check } }