Skip to content

Commit 94bf42c

Browse files
committed
chore(vdev): filter empty strings from parsed FEATURES to avoid --features "" on FEATURES=
1 parent 75b53d8 commit 94bf42c

4 files changed

Lines changed: 30 additions & 8 deletions

File tree

vdev/src/commands/build/vector.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,12 @@ impl Cli {
3131
command.arg("--release");
3232
}
3333

34-
command.features(&self.features);
34+
let features: Vec<String> = self
35+
.features
36+
.into_iter()
37+
.filter(|f| !f.is_empty())
38+
.collect();
39+
command.features(&features);
3540

3641
let target = self.target.unwrap_or_else(platform::default_target);
3742
command.args(["--target", &target]);

vdev/src/commands/check/rust.rs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,17 @@ impl Cli {
3939
Vec::default()
4040
};
4141

42-
let feature_args = if self.no_default_features || !self.features.is_empty() {
42+
let features: Vec<&str> = self
43+
.features
44+
.iter()
45+
.map(String::as_str)
46+
.filter(|f| !f.is_empty())
47+
.collect();
48+
let feature_args = if self.no_default_features || !features.is_empty() {
4349
let mut args = vec!["--no-default-features".to_string()];
44-
if !self.features.is_empty() {
50+
if !features.is_empty() {
4551
args.push("--features".to_string());
46-
args.push(self.features.join(","));
52+
args.push(features.join(","));
4753
}
4854
args
4955
} else {

vdev/src/commands/crate_versions.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,15 @@ impl Cli {
2727
pub fn exec(self) -> Result<()> {
2828
let re_crate = Regex::new(r" (\S+) v([0-9.]+)").unwrap();
2929
let mut versions: HashMap<String, HashSet<String>> = HashMap::default();
30+
let features: Vec<String> = self
31+
.features
32+
.into_iter()
33+
.filter(|f| !f.is_empty())
34+
.collect();
3035

3136
for line in Command::new("cargo")
3237
.arg("tree")
33-
.features(&self.features)
38+
.features(&features)
3439
.check_output()?
3540
.lines()
3641
{

vdev/src/commands/test.rs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,16 @@ impl Cli {
4646
args.append(&mut extra_args);
4747
}
4848

49-
if self.no_default_features || !self.features.is_empty() {
49+
let features: Vec<String> = self
50+
.features
51+
.into_iter()
52+
.filter(|f| !f.is_empty())
53+
.collect();
54+
55+
if self.no_default_features || !features.is_empty() {
5056
args.push("--no-default-features".to_string());
51-
if !self.features.is_empty() {
52-
args.extend(["--features".to_string(), self.features.join(",")]);
57+
if !features.is_empty() {
58+
args.extend(["--features".to_string(), features.join(",")]);
5359
}
5460
} else if !args.contains(&"--features".to_string()) {
5561
args.extend([

0 commit comments

Comments
 (0)