Tooling Flashcards
What is Rustup?
A tool to install the rust toolchain and update it (among others?)
What is rustc?
The rust compiler.
Compile a file with
rustc file.rs
Then run it with
./file
what is rustfmt?
Automatic formatter included with the standard rust distribution.
What is cargo?
Package manager and build system!
Builds code, downloads libraries, builds libraries,
How to create a new project?
Either by creating an .rs file manually or using cargo new
cargo new hello_cargo
How to create a new project?
Either by creating an .rs file manually or using cargo new
cargo new hello_cargo
Anatomy of a rust project
Cargo.toml
src/
target/ (git ignored)
What does TOML stand for?
Toms obvious minimal language.
What cargo commands are useful?
cargo new
cargo run
cargo check (build without creating executable to check whether it compiles)
cargo build
cargo add (new command to add dependencies)
cargo update (only updates within semver, change manually in toml file to update further)
cargo doc –open (build all docs of your packages locally and open in browser)