Getting Started with Rust
Install and Run Your First Project
Published in
2 min readSep 5, 2024
Mac OS
Cargo is installed along with Rust using Homebrew.
Cargo — It is the rust package manager and build system
brew install rust
Rustup
- You can use
rustup
to manage the version of Rust. - It is similar to
nvm
(Node Version Manager) in Node.js. - Installing
rustup
enables you to easily switch between stable, beta, and nightly compilers and keep them updated.
brew install rustup
Create your first project using Rust
cargo new rust-project
cd rust-project
Open the file path in your IDE
- You will see a
Cargo.toml
file which is similar to thepackage.json
file in Node.js. - There will be
main.rs
file in the src directory which is similar toindex.js
file in Node.js.
Cargo.toml -> package.json
main.rs -> index.js
Useful Extensions for Visual Studio Code Setup
You can install the below Extensions,
- rust-analyser — It is…