Skip to main content

required_features

Function required_features 

fn required_features(root: &Path, example: &str) -> Vec<String>
Expand description

The features an example declares through [[example]] required-features.

§6.1 says “examples needing a feature declare it with required-features in crates/atune/Cargo.toml”, and that mechanism only works if the runner passes them: cargo run --example <name> on a gated example fails outright with target '<name>' in package 'atune' requires the features: '<feature>' (§1.3.65). Reading the manifest keeps the build light — the alternative, --all-features for every example, drags faer and a bundled SQLite C compile into a run that may need neither.

A manifest that cannot be read or parsed yields no features rather than an error: the caller is about to run cargo, which will produce a far better message than anything this function could invent.