diff --git a/src/cargo_shim/mod.rs b/src/cargo_shim/mod.rs index 07acc85..706b2ab 100644 --- a/src/cargo_shim/mod.rs +++ b/src/cargo_shim/mod.rs @@ -299,6 +299,12 @@ impl CargoProject { command.arg( "--all-features" ); } + let features = features + .iter() + .filter(|f| !f.is_empty()) + .cloned() + .collect::>(); + if !features.is_empty() { command.arg( "--features" ); command.arg( &features.join( " " ) ); @@ -697,8 +703,13 @@ impl BuildConfig { if self.enable_all_features { command.arg( "--all-features" ); } + + let features = self.features + .iter() + .filter(|f| !f.is_empty()) + .collect::>(); - if !self.features.is_empty() { + if !features.is_empty() { command.arg( "--features" ); command.arg( &self.features.join( " " ) ); }