Hello,
I am trying to enable a feature in a dummy program and can't seem to get it working.
I have the following code:
fn main() {
if cfg!(features = "hello") {
println!("Feature enabled");
} else {
println!("Feature disabled");
}
}
My Cargo.toml is the following:
...
[dependencies]
[features]
hello = []
I tried running the following commands:
cargo build --features "hello"
cargo run --features "hello"
and also:
rustc src/main.rs --features "hello"
But the output I get is always:
Feature disabled
What am I doing wrong?
Thanks!