cargo

Rust cargo run

Build and execute a binary target. Separate arguments for Cargo from arguments for the program with --. Example format: shell; run from a disposable copy of v15/fixtures/projects/receipt. Expected result (not executed): 20 Why: The receipt program multiplies five items by four. Common mistake: Putting the quantity before --, where Cargo would parse it.

Formal Syntax & Structure

rust syntaxrust
cargo run [OPTIONS]

Working Example

Example Snippetrust
cargo run --offline --quiet -- 5
Rust Reference