Introduction
Why Rust?
Rust is a systems programming language that runs blazingly fast, prevents segfaults, and guarantees thread safety.
Install Rust into Arch Linux
sudo pacman -S rust
# check version
rustc --versionHow to use Rust
Create a new project
cargo new hello-rust
cd hello-rustCargo commands
Build and run
cargo build
cargo runCargo watch
cargo install cargo-watch # install cargo-watch
sudo pacman -S cargo-watch # install cargo-watch
cargo watch -x runBuild for release
cargo build --releaseBuild and run tests
cargo testBuild and run benchmarks
cargo benchBuild and run documentation
cargo doc --openBuild and run clippy
cargo clippyBuild and run rustfmt
cargo fmtBuild and run rustfix
cargo fixBuild and run rust-analyzer
cargo xtask install --serverBuild and run cargo-audit
cargo audit