Quick exercices to learn Rust
Clone or download
Pull request Compare This branch is 2 commits behind loganmzz:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
01-basic
02-control
03-types
04-ownership
05-lifetime
06-trait
07-pattern_matching
08-generics
09-error_management
10-closure
11-collections
12-parallelism
13-memory
99-challenge
solutions
src
.gitignore
Cargo.toml
README.md

README.md

Welcome to Rust workshop

It consists into a list of "crates" (packaging name in Rust). Your goal is to make test passes using cargo test. You start with 01-basic, and when you're done, go to 02-... and continue this way until the end ! All code to touch are in /src/tests.rs files.

Each crate is documented with few explanations/instructions, so generate all documentation with cargo doc --all and then open it with cargo doc --open !

Before proceeding, you need to install a working environment !

Installing Rust

At the time of writing, the easiest way is to use rustup.

Note: under Windows, you will have to choose between two options. For gnu, you need nothing special ; rustup will automatically install GNU compiler tools. For msvc, you need to install Visual C++ Build Tools 2015 ; click here for more details.

To check your installation, just run cargo run from repository root directory. It should prints

Congrulations !
You have compiled and run your first Rust program

Next, go to '01-basic' and make all tests passes with 'cargo test'

Installing editor

Visual Studio Code

Rust (rls) is currently the recommended extension. It is provided by Rust Developer Tools team (whih also provides Rust Language Server).

There is also Rust but it's not actively developped. In this case, using RLS mode is highly recommanded.

IntelliJ IDEA

Note: you can also use other IntelliJ-based products. But IntelliJ IDEA has a community version.

IntelliJ Rust is the official plug-ins. Firstly, started as side projects from JetBrains employees. Since summer 2017, it is officially supported by JetBrains.

Others

You can find more supported IDEs at Are we (I)DE yet?.