12
Do people use Cargo?
(lemmy.world)
Welcome to the Rust community! This is a place to discuss about the Rust programming language.
Credits
cargo install
is for installing rust programs for your user, not for adding dependencies to your Rust project. Many cargo subcommands can be installed this way, for instancecargo bloat
.Cargo.toml
, because it is the file you need to write in order to configure cargo for your Rust project. TOML is the name of the file format. For details, please see the introductory chapter to Cargo in the Rust book.cargo add
, which allows to add dependencies directly on the command line. However, all it does is to add/edit/remove the respective lines in Cargo.toml. (Personal opinion: I have found it way easier to just edit the file directly than to learn yet another command...)That said: You still need to edit the Cargo.toml file, even if you solely use
cargo add
to manage your dependencies. That's because that file contains a lot more information about your project than just the dependencies. For instance the current version, the feature-flags, your name, a link to the public repo,...