I'm using Cargo Features (https://doc.rust-lang.org/cargo/reference/features.html) to specify conditional compilation options. Is there a way to enable a set of these features for a given Cargo profile (https://doc.rust-lang.org/cargo/reference/profiles.html)?
For example, something like this (which does not seem to work):
[features]
foo = []
[profile.test]
features = ["foo"]
So that I don't have to write cargo test --features "foo" but will instead just write cargo test.
Unfortunately there isn't any option which can help in specifying automatic features for profiles.
You can make aliases in your shell for running those repeated commands or better yet, use Just which is an amazing command runner written in Rust.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With