A very simple extension for working with Rust.
Adds Cargo to your PATH so Rust commands work globally:
PATH="$HOME/.cargo/bin:$PATH"
-
Install Rust (via rustup):
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -
(This .matrix extension does this for you..) Add Cargo to your
PATH:PATH="$HOME/.cargo/bin:$PATH"
-
Rustup -- Toolchain installer & manager (includes Cargo)
-
Cargo -- Build system & package manager
-
C compiler & linker -- Needed for crates with native code
-
Linux:
sudo apt install build-essential -
macOS:
xcode-select --install -
Windows: Install Visual Studio Build Tools (C++ workload)
-
-
Git -- For fetching dependencies from repositories
-
(Optional) rust-analyzer -- IDE integration for autocompletion, type hints, and docs
Verify your Rust installation:
rustc --version
cargo --versionCreate and run a sample project:
cargo new hello-rust
cd hello-rust
cargo runYou should see:
Hello, world!