Commands and other info for rust
Information sources:
Rust Crash course (Traversy Media)
Link: https://www.rust-lang.org/tools/install
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
In zsh
shell, check the $HOME/.zshenv
file to get the rust init command. It is something like source "$HOME/.cargo/env"
cargo --version
rustup --version
rustc --version
cargo - rust package manager rustup - for upgrades rustc - the compiler
rustup update
rustup self uninstall
rustc program.rs
Init in current directory
cargo init
Create new directory and init
cargo new <new-directory>
Run the project
cargo run
Build debug: (under ./target/debug
)
cargo build
Build release: (under ./target/debug
)
cargo build --release