Here's a checklist for this week's tasks:
- Create a repository from the template.
- Install the Rust toolchain.
- Setup your editor for Rust development.
If you're using Visual Studio Code, simply install the recommended extensions.
For other editors, make sure the following is working:
- LSP (rust-analyzer)
- debugging support
- Configure your LSP to use Rust's official linter, clippy.
- Instructions for Visual Studio Code
-
hello-clippy
contains linter warnings. Confirm that your editor shows them to you, then fix them.
- Setup rustlings:
- run
cargo install rustlings
- in the root of your repo, run
rustlings init
This will create therustlings
folder containing all the exercises. (If you want to check their initial state into version control, now's a good time.)
- run
- Solve rustlings exercises (run the command
rustlings
inside therustlings/
folder).- intro
- variables
- if
- functions
- quiz 1
- primitive types
- vectors
- move semantics (== ownership)
The purpose here is to get you comfortable reading documentation and make you aware of some useful things. Don't get bogged down in the details. Read until you are satisfied and make a mental note that these things exist.
- Check out "Rust By Example"
- standard library documentation
str::chars
str::split
str::lines
str::parse
fmt
(module-level documentation of string formatting syntax, used inprintln!
)env::args
slice::reverse
slice::sort
slice::windows
dbg!
include_str!
todo!
If you have time and enthusiasm to spare, you can solve some of these exercises. You are encouraged to ask your workshop organizer for a code review! Feedback will focus on adding information, pointing out different ways of doing things and discussing trade-offs. (no nitpicking / perfectionism)
These exercises were selected because you already learned about everything required to solve them. However, a performant and or elegant solution might still be out of reach! So, keep your perfectionism in check for now. You can always revisit these exercises later to refactor them.
This is not a checklist, but rather an "allow-list"! Just start with one that appeals to you and do as many as you like. Exercism focuses on exercises that are designed to push you to use specific language features. Advent of Code on the other hand is more free-form problem solving.
Make sure you finished the standard library reading, some of those items might come in handy 😉
- Exercism (setup recommendations in the top-level readme)
- Grains: bit fiddling
- Leap: boolean operators
- Prime Factors: arithmetic, vectors
- Proverb: slices, string manipulation
- Matching Brackets: vectors, characters
- Sieve (of Eratosthenes): arithmetic, vectors
- Secret Handshake: bit fiddling, vectors
- Advent of Code (setup recommendations in the top-level readme)