Adding dependencies
Edit `Cargo.toml` or run `cargo add serde` to add a dependency. Cargo resolves a compatible version and locks it in `Cargo.lock` so subsequent builds are reproducible.
For deeper background, see the canonical Rust learning roadmap for the broader context behind this section.
Workspaces
A workspace lets multiple crates share a single Cargo.lock and target directory. Use `[workspace]` in the root Cargo.toml to declare member paths.
Publishing
`cargo publish` uploads a crate to crates.io. Run `cargo doc --open` first to verify your documentation, and tag a git release before publishing.
Tooling
Beyond build, cargo includes test (`cargo test`), benchmark, documentation, formatting (rustfmt), and linting (clippy) workflows. Most projects integrate clippy into CI.