An Interest In:
Web News this Week
- April 23, 2024
- April 22, 2024
- April 21, 2024
- April 20, 2024
- April 19, 2024
- April 18, 2024
- April 17, 2024
March 21, 2021 04:11 am GMT
Original Link: https://dev.to/kaitoii11/command-to-easily-maintain-rust-dependencies-with-command-line-5fmm
Command to easily maintain rust dependencies with command line
Cargo edit
Cargo edit extends cargo by adding the following subcommands.
As you can guess by their names, the subcommands modify Cargo.toml from the command line.
- cargo add
- cargo rm
- cargo upgrade
Install
$ cargo install cargo-edit
cargo add
$ cargo add imageUpdating 'https://github.com/rust-lang/crates.io-index' indexAdding image v0.23.14 to dependencies$ cat Cargo.toml [dependencies]image = "0.23.14"
Add dependencies with a specific version.
$ cargo add image --vers=0.20 Updating 'https://github.com/rust-lang/crates.io-index' index Adding image v0.20 to dependencies ii@ii-pro ~/t/r/image master ? $ cat Cargo.toml [dependencies]image = "0.20"
cargo upgrade
$ cargo upgrade image Updating 'https://github.com/rust-lang/crates.io-index' indeximage: Upgrading image v0.20 -> v0.23.14
cargo rm
$ cargo rm imageRemoving image from dependencies$ cat Cargo.toml
Original Link: https://dev.to/kaitoii11/command-to-easily-maintain-rust-dependencies-with-command-line-5fmm
Share this article:
Tweet
View Full Article
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To