Skip to content

Commit d15cdbf

Browse files
bors[bot]mciantyre
andauthored
Merge #83
83: Support multiple cargo_metadata feature options r=therealprof a=mciantyre The PR follows #78, which did not correct `cargo_metadata` feature exclusivity. oli-obk/cargo_metadata#118 lets us combine feature options, like `--no-default-features --features foo`, so we can fix our usage here. As of this PR, the return of `cargo_metadata` will truly reflect whatever feature options the user passes to `cargo-binutils`. The `cargo_metadata` change was published in `0.10.1`, but this PR bumps to `0.11`, which is backwards compatible with `0.10`. Co-authored-by: Ian McIntyre <ianpmcintyre@gmail.com>
2 parents 80fe0a9 + f294028 commit d15cdbf

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ repository = "https://github.com/rust-embedded/cargo-binutils/"
1515
version = "0.3.0"
1616

1717
[dependencies]
18-
cargo_metadata = "0.10"
18+
cargo_metadata = "0.11"
1919
clap = "2.33"
2020
regex = "1.3"
2121
rustc-cfg = "0.4"

src/lib.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,9 +280,11 @@ pub fn run(tool: Tool, matches: ArgMatches) -> Result<i32> {
280280
metadata_command.features(CargoOpt::SomeFeatures(
281281
features.map(|s| s.to_owned()).collect(),
282282
));
283-
} else if matches.is_present("no-default-features") {
283+
}
284+
if matches.is_present("no-default-features") {
284285
metadata_command.features(CargoOpt::NoDefaultFeatures);
285-
} else if matches.is_present("all-features") {
286+
}
287+
if matches.is_present("all-features") {
286288
metadata_command.features(CargoOpt::AllFeatures);
287289
}
288290
let metadata = metadata_command.exec()?;

0 commit comments

Comments
 (0)