cargo
Rust Cargo target selection
A package may contain more than one compilable target. Select an example explicitly to run a small usage demonstration without changing the main binary. Example format: shell; run from a disposable copy of v15/fixtures/projects/receipt. Expected result (not executed): 4 Why: The examples/single.rs target calls the library for one item. Common mistake: Confusing an example target with a target triple.
Formal Syntax & Structure
rust syntaxrust
cargo run --example NAMEWorking Example
Example Snippetrust
cargo run --offline --quiet --example single