Skip to content

Instantly share code, notes, and snippets.

@PhDP
Last active September 23, 2021 22:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PhDP/1096943dfeabb8e8ce3ba9c79e285138 to your computer and use it in GitHub Desktop.
Save PhDP/1096943dfeabb8e8ce3ba9c79e285138 to your computer and use it in GitHub Desktop.
Installing Rust

Installing Rust

Most editors/IDEs have good Rust support at this point, but I recommend Visual Code with Rust Analyzer.

Linux or OSX

Simply copy and paste the command from the rustup website (here) in a terminal. Rustup will install the rustc compiler and, just as importantly, the cargo package manager.

You should add the clippy extension to rust with

rustup component add clippy

Clippy gives important hints (and tips and warnings) to improve code quality.

To test the installation, you can create a simple package and build/test it with the commands:

cargo new --lib x
cd x
cargo build
cargo test

Windows

Because Windows is weird and makes everything difficult to install, it's much easier to just install the Windows Subsystem for Linux 2 (which is awesome) and follow the instructions for Linux/OSX.

You can then install Visual Code on Windows and use with this extension to launch visual code on the WSL2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment