cargo
cargo comes preinstalled with rustup.
Usage
-
cargo new→ either creates a new folder with aCargo.toml, asrc/main.rsand initializes a git repo (by default). -
cargo initin a preexisting folder. -
cargo new --vcs→ to change the version control tool. -
cargo buildto compile and create an executable.--debug(which is by default) compiles faster then--release. -
cargo runto compile and immediatly run the resulting executable, without making an executable. Faster thenbuild -
cargo checkto check the code without making an executable nor running the program. Serves to check if the program still compiles. It is faster thenrunandbuild. -
cargo run/build --offlineto use local offline dep instead of online. -
cargo addto add dependencies to the project (and automatically in theCargo.toml).