Skip to content

Commit

Permalink
Treat quoted empty string as an empty string (#569)
Browse files Browse the repository at this point in the history
  • Loading branch information
HadrienG2 authored Oct 29, 2023
1 parent 4bce03d commit f9d0e46
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ impl From<CheckRelease> for cargo_semver_checks::Check {

// Treat --features="" as a no-op like cargo does
let trim_features = |features: &mut Vec<String>| {
features.retain(|feature| !feature.is_empty());
features.retain(|feature| !(feature.is_empty() || feature == "\"\""));
};
trim_features(&mut current_features);
trim_features(&mut baseline_features);
Expand All @@ -370,8 +370,8 @@ fn features_empty_string_is_no_op() {

let empty_features = CheckRelease {
features: vec![String::new()],
current_features: vec![String::new(), String::new()],
baseline_features: vec![String::new()],
current_features: vec![String::new(), "\"\"".to_string()],
baseline_features: vec!["\"\"".to_string()],
..no_features.clone()
};

Expand Down

0 comments on commit f9d0e46

Please sign in to comment.