You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Go to file
Carol (Nichols || Goulding) 291182d308
Merge remote-tracking branch 'origin/pr/62'
6 years ago
error_handling Added filename to top of .rs files 6 years ago
functions Fix line numbers 6 years ago
if Added filename to top of .rs files 6 years ago
macros Added filename to top of .rs files 6 years ago
modules Added filename to top of .rs files 6 years ago
move_semantics Fix line numbers 6 years ago
primitive_types Added filename to top of .rs files 6 years ago
src/bin Don't be lazy, actually read the file instead of including it at compile time 6 years ago
standard_library_types Added filename to top of .rs files 6 years ago
strings Fix line numbers 6 years ago
tests Added filename to top of .rs files 6 years ago
threads Fix line numbers 6 years ago
variables Fix line numbers 6 years ago
.gitignore Start a script to regenerate README.md from a template 6 years ago
Cargo.lock Update to btbytes' prlink because they merged my PR already!! 6 years ago
Cargo.toml Update to btbytes' prlink because they merged my PR already!! 6 years ago
LICENSE Update LICENSE year. 8 years ago
README-template.hbs Make a handlebars helper that uses prlink to generate a link from a file 6 years ago
README.md Merge remote-tracking branch 'origin/pr/62' 6 years ago
ex1.rs Added filename to top of .rs files 6 years ago
ex2.rs Added filename to top of .rs files 6 years ago
ex3.rs Added filename to top of .rs files 6 years ago
ex4.rs Added filename to top of .rs files 6 years ago
ex5.rs Added filename to top of .rs files 6 years ago

README.md

rustlings

Small exercises to get you used to reading and writing Rust code. Includes practice reading and responding to compiler messages!

This repo is very much the smallest thing that could possibly work :)

To do these exercises

Thanks to btbytes' prlinks, you can now click on the links below to load the exercises in the rust playground!

There are infinite correct answers-- the exercises are sometimes left very open-ended. Scroll down in the playground to find comments that have hints.

If you need more help or would like to compare solutions, you can ask in #rust-beginners on irc.mozilla.org, the user forum, or the subreddit. If an exercise could be improved in any way, please create an issue or submit a pull request!

Variable bindings

Relevant chapter in The Rust Programming Language

Functions

Relevant chapter in The Rust Programming Language

Primitive types

Relevant chapter in The Rust Programming Language

Tests

Going out of order from the Syntax and Semantics section of the book to cover tests-- many of the following exercises will ask you to make tests pass!

Testing chapter of the book

If

Relevant chapter in The Rust Programming Language

Strings

Relevant chapter in The Rust Programming Language

Move semantics

These exercises are adapted from pnkfelix's Rust Tutorial -- thank you Felix!!!

Relevant chapters in the book:

Note that the exercises in this section may look similar to each other but they are subtly different :)

Modules

Relevant chapter in The Rust Programming Language

Macros

Check out the Macros section of the first book.

Error Handling

The Error Handling and Generics sections are relevant.

Standard library types

Arc

The Concurrency section is relevant.

Iterators

Do not adjust your monitors-- iterators 1 and 2 are indeed missing. Iterator 3 is a bit challenging so we're leaving space for some exercises to lead up to it!

Check out the Iterators chapter of the book and the Iterator docs.

Threads

See the Dining Philosophers example and the Concurrency Chapter from the book.

Uncategorized

A few exercises based on things I've encountered or had trouble with getting used to.

To help with this repo/TODO list

  • File issues for problems or suggestions!
  • Contribute more exercises! Anything that took you time to get used to, or that you had trouble with, or that deserves practice would be a good exercise!
  • How could the process of doing these exercises work better? This is an open-ended question :) Are the playground links good enough? Are there ways that we could make going to the next exercise easier without forking the playground??