Rust
Dependencies Commands
Manage crate dependencies with Cargo. Add, update, and audit dependencies, understand version resolution, and use features for conditional compilation.
6 commands
Pro Tips
Use 'cargo add serde --features derive' to add dependencies with features from the command line.
Use 'cargo tree' to visualize the dependency graph and find duplicate versions of crates.
Use 'cargo update -p specific-crate' to update just one dependency without touching others.
Common Mistakes
Enabling too many features increases compile times. Only enable features you actually use.
Wildcard dependencies ('*') are not allowed on crates.io. Always specify version ranges.