New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

handle cargo features flags #36

Merged
merged 1 commit into from Jun 6, 2018

Conversation

Projects
None yet
2 participants
@gibix
Contributor

gibix commented May 30, 2018

Not sure about the API, if sounds good I can write an example before merging.

@oli-obk

API looks good to me. Some test would be great, yes.

src/lib.rs Outdated
match feat {
CargoOpt::AllFeatures => cmd.arg("--features-all"),
CargoOpt::NoDefaultFeatures => cmd.arg("--no-default-features"),
CargoOpt::SomeFeatures(ftrs) => cmd.arg(format!("--fatures {:?}", ftrs)),

This comment has been minimized.

@oli-obk

oli-obk May 30, 2018

Owner

typo: fatures

src/lib.rs Outdated
CargoOpt::AllFeatures => cmd.arg("--features-all"),
CargoOpt::NoDefaultFeatures => cmd.arg("--no-default-features"),
CargoOpt::SomeFeatures(ftrs) => cmd.arg(format!("--fatures {:?}", ftrs)),
CargoOpt::DefaultFeatures => cmd.arg(""),

This comment has been minimized.

@oli-obk

oli-obk May 30, 2018

Owner

This arm should be a nop {} arm instead of adding an empty argument

This comment has been minimized.

@gibix

gibix May 30, 2018

Contributor

is not possible to give a nop arg because cmd.arg returns a Command. Suggestions?

This comment has been minimized.

@oli-obk

oli-obk May 30, 2018

Owner

Just make the last arm cmd instead of cmd.arg(""), that should do it.

@gibix gibix force-pushed the gibix:add-features-flag branch from b378d88 to 202800b May 30, 2018

@gibix

This comment has been minimized.

Contributor

gibix commented May 31, 2018

changed to Option`

src/lib.rs Outdated
@@ -247,6 +268,14 @@ pub fn metadata_deps(manifest_path: Option<&Path>, deps: bool) -> Result<Metadat
cmd.arg("--no-deps");
}
if features.is_some() {

This comment has been minimized.

@oli-obk

oli-obk May 31, 2018

Owner

if let Some(features) = features saves you the unwrap

This comment has been minimized.

@gibix

gibix May 31, 2018

Contributor

done, thanks for the feedback, is a rust-beginner contribution ;)

@gibix gibix force-pushed the gibix:add-features-flag branch from 202800b to fc5edf5 May 31, 2018

@oli-obk

This comment has been minimized.

Owner

oli-obk commented May 31, 2018

I can write an example before merging.

Code looks good to me! Can you write this example so we have some form of testing for this feature?

@gibix gibix force-pushed the gibix:add-features-flag branch from fc5edf5 to 6d3f291 May 31, 2018

@gibix

This comment has been minimized.

Contributor

gibix commented Jun 6, 2018

ping

@oli-obk oli-obk merged commit fca7459 into oli-obk:master Jun 6, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@oli-obk

This comment has been minimized.

Owner

oli-obk commented Jun 6, 2018

0.5.6 has been published with this feature

@gibix

This comment has been minimized.

Contributor

gibix commented Jun 6, 2018

thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment