Here's my Cargo.toml
[dependencies]
clap = "*"
I copied the code from here: clap::load_yaml - Rust
fn main() {
let yaml = load_yaml!("app.yaml");
let app = App::from(yaml);
}
Using: rustc 1.67.1 (d5a82bbd2 2023-02-07)
This is what I get:
cargo build
Compiling test-clap-yaml v0.1.0 (/tmp/test-clap-yaml)
error[E0432]: unresolved import `clap::App`
--> src/main.rs:1:5
|
1 | use clap::App;
| ^^^^^^^^^ no `App` in the root
error: cannot find macro `load_yaml` in this scope
--> src/main.rs:3:16
|
3 | let yaml = load_yaml!("app.yaml");
| ^^^^^^^^^
Is the documentation is wrong?