cargo
Rust cargo add
Modify a manifest using Cargo instead of editing TOML manually. A local path avoids downloading an unfamiliar dependency. Work in a disposable copy of edit-app. Example format: shell; run from a disposable copy of v15/fixtures/projects/edit-app. Expected result (not executed): A price entry appears in [dependencies]. Why: The path identifies a valid local package. Common mistake: Running add in the wrong project or assuming it changes Rust imports automatically.
Formal Syntax & Structure
rust syntaxrust
cargo add [OPTIONS]Working Example
Example Snippetrust
cargo add --offline --path price