Cargo

Cargo frequently used subcommands

cargo --help

cargo --version

Creates project under new sub folder

cargo new projectname

Creates project under existing folder

cargo init projectname

Compile the current package

cargo build

Compile the current package for Production

* cargo build --release

Run the current package

cargo run

Check the current package for dependency errors

cargo check

Fetch dependencies of a package from the network

cargo fetch

Execute unit and integration tests of a package

cargo test

Remove generated artifacts

cargo clean

Update dependencies as recorded in the local lock file

cargo update

Build package's documentation

cargo doc

Format the code

cargo fmt

Refer more Cargo commands in Cargo Book

Cargo Book