cargo add [OPTIONS] <DEP> is a useful command that adds dependencies to a
Cargo.toml manifest file.
cargo install cargo-edit
In the root of your project run:
cargo add serde
This will add the dependency and update your
For full instructions, run
cargo add --help.
If you have overridden your access to a remote git service to use SSH rather than HTTPS, you may need to tweak your
cargo add serde Updating 'https://github.com/rust-lang/crates.io-index' index Error: failed to acquire username/password from local configuration Caused by: failed to acquire username/password from local configuration
The solution - add this to
# existing github.com override [url "firstname.lastname@example.org:"] insteadOf = https://github.com/ # fine-tune the override to avoid issues with cargo-edit [url "https://github.com/rust-lang/crates.io-index"] insteadOf = https://github.com/rust-lang/crates.io-index
comments powered by Disqus