:crab: Small exercises to get you used to reading and writing Rust code!

Overview

All Contributors

rustlings ๐Ÿฆ€ โค๏ธ

Greetings and welcome to rustlings. This project contains small exercises to get you used to reading and writing Rust code. This includes reading and responding to compiler messages!

...looking for the old, web-based version of Rustlings? Try here

Alternatively, for a first-time Rust learner, there are several other resources:

  • The Book - The most comprehensive resource for learning Rust, but a bit theoretical sometimes. You will be using this along with Rustlings!
  • Rust By Example - Learn Rust by solving little exercises! It's almost like rustlings, but online

Getting Started

Note: If you're on MacOS, make sure you've installed Xcode and its developer tools by typing xcode-select --install.

You will need to have Rust installed. You can get it by visiting https://rustup.rs. This'll also install Cargo, Rust's package/project manager.

MacOS/Linux

Just run:

curl -L https://git.io/rustlings | bash
# Or if you want it to be installed to a different path:
curl -L https://git.io/rustlings | bash -s mypath/

This will install Rustlings and give you access to the rustlings command. Run it to get started!

Windows

In PowerShell, set ExecutionPolicy to RemoteSigned:

Set-ExecutionPolicy RemoteSigned

Then, you can run:

Start-BitsTransfer -Source https://git.io/rustlings-win -Destination $env:TMP/install_rustlings.ps1; Unblock-File $env:TMP/install_rustlings.ps1; Invoke-Expression $env:TMP/install_rustlings.ps1

To install Rustlings. Same as on MacOS/Linux, you will have access to the rustlings command after it.

When you get a permission denied message then you have to exclude the directory where you placed the rustlings in your virus-scanner

Browser:

Run on Repl.it

Open in Gitpod

Manually

Basically: Clone the repository, checkout to the latest tag, run cargo install.

git clone https://github.com/rust-lang/rustlings
cd rustlings
git checkout tags/4.3.0 # or whatever the latest version is (find out at https://github.com/rust-lang/rustlings/releases/latest)
cargo install --force --path .

If there are installation errors, ensure that your toolchain is up to date. For the latest, run:

rustup update

Then, same as above, run rustlings to get started.

Doing exercises

The exercises are sorted by topic and can be found in the subdirectory rustlings/exercises/<topic>. For every topic there is an additional README file with some resources to get you started on the topic. We really recommend that you have a look at them before you start.

The task is simple. Most exercises contain an error that keeps them from compiling, and it's up to you to fix it! Some exercises are also run as tests, but rustlings handles them all the same. To run the exercises in the recommended order, execute:

rustlings watch

This will try to verify the completion of every exercise in a predetermined order (what we think is best for newcomers). It will also rerun automatically every time you change a file in the exercises/ directory. If you want to only run it once, you can use:

rustlings verify

This will do the same as watch, but it'll quit after running.

In case you want to go by your own order, or want to only verify a single exercise, you can run:

rustlings run myExercise1

In case you get stuck, you can run the following command to get a hint for your exercise:

rustlings hint myExercise1

Testing yourself

After every couple of sections, there will be a quiz that'll test your knowledge on a bunch of sections at once. These quizzes are found in exercises/quizN.rs.

Continuing On

Once you've completed Rustlings, put your new knowledge to good use! Continue practicing your Rust skills by building your own projects, contributing to Rustlings, or finding other open-source projects to contribute to.

Uninstalling Rustlings

If you want to remove Rustlings from your system, there's two steps. First, you'll need to remove the exercises folder that the install script created for you:

rm -rf rustlings # or your custom folder name, if you chose and or renamed it

Second, since Rustlings got installed via cargo install, it's only reasonable to assume that you can also remove it using Cargo, and exactly that is the case. Run cargo uninstall to remove the rustlings binary:

cargo uninstall rustlings

Now you should be done!

Completion

Rustlings isn't done; there are a couple of sections that are very experimental and don't have proper documentation. These include:

  • Errors (exercises/errors/)
  • Option (exercises/option/)
  • Result (exercises/result/)
  • Move Semantics (could still be improved, exercises/move_semantics/)

Additionally, we could use exercises on a couple of topics:

  • Structs
  • Better ownership stuff
  • impl
  • ??? probably more

If you are interested in improving or adding new ones, please feel free to contribute! Read on for more information :)

Contributing

See CONTRIBUTING.md.

Contributors โœจ

Thanks goes to these wonderful people (emoji key):


Carol (Nichols || Goulding)

๐Ÿ’ป ๐Ÿ–‹

QuietMisdreavus

๐Ÿ’ป ๐Ÿ–‹

Robert M Lugg

๐Ÿ–‹

Hynek Schlawack

๐Ÿ’ป

Katharina Fey

๐Ÿ’ป

lukabavdaz

๐Ÿ’ป ๐Ÿ–‹

Erik Vesteraas

๐Ÿ’ป

delet0r

๐Ÿ’ป

Shaun Bennett

๐Ÿ’ป

Andrew Bagshaw

๐Ÿ’ป

Kyle Isom

๐Ÿ’ป

Colin Pitrat

๐Ÿ’ป

Zac Anger

๐Ÿ’ป

Matthias Geier

๐Ÿ’ป

Chris Pearce

๐Ÿ’ป

Yvan Sraka

๐Ÿ’ป

Denys Smirnov

๐Ÿ’ป

eddyp

๐Ÿ’ป

Brian Kung

๐Ÿ’ป ๐Ÿ–‹

Russell

๐Ÿ’ป

Dan Wilhelm

๐Ÿ“–

Jesse

๐Ÿ’ป ๐Ÿ–‹

Fredrik Jambrรฉn

๐Ÿ’ป

Pete McFarlane

๐Ÿ–‹

nkanderson

๐Ÿ’ป ๐Ÿ–‹

Ajax M

๐Ÿ“–

Dylan Nugent

๐Ÿ–‹

vyaslav

๐Ÿ’ป ๐Ÿ–‹

George

๐Ÿ’ป

Thomas Holloway

๐Ÿ’ป ๐Ÿ–‹

Jubilee

๐Ÿ’ป

WofWca

๐Ÿ’ป

Roberto Vidal

๐Ÿ’ป ๐Ÿ“– ๐Ÿค” ๐Ÿšง

Jens

๐Ÿ“–

Rahat Ahmed

๐Ÿ“–

Abdou Seck

๐Ÿ’ป ๐Ÿ–‹ ๐Ÿ‘€

Katie

๐Ÿ’ป

Socrates

๐Ÿ“–

gnodarse

๐Ÿ–‹

Harrison Metzger

๐Ÿ’ป

Torben Jonas

๐Ÿ’ป ๐Ÿ–‹

Paul Bissex

๐Ÿ“–

Steven Mann

๐Ÿ’ป ๐Ÿ–‹

Mario Reder

๐Ÿ’ป ๐Ÿ–‹

skim

๐Ÿ’ป

Sanjay K

๐Ÿ’ป ๐Ÿ–‹

Rohan Jain

๐Ÿ’ป

Said Aspen

๐Ÿ’ป ๐Ÿ–‹

Ufuk Celebi

๐Ÿ’ป

lebedevsergey

๐Ÿ“–

Aleksei Trifonov

๐Ÿ–‹

Darren Meehan

๐Ÿ–‹

Jihchi Lee

๐Ÿ–‹

Christofer Bertonha

๐Ÿ–‹

Vivek Bharath Akupatni

๐Ÿ’ป โš ๏ธ

Dรญdac Sementรฉ Fernรกndez

๐Ÿ’ป ๐Ÿ–‹

Rob Story

๐Ÿ’ป

Siobhan Jacobson

๐Ÿ’ป

Evan Carroll

๐Ÿ–‹

Jawaad Mahmood

๐Ÿ–‹

Gaurang Tandon

๐Ÿ–‹

Stefan Kupresak

๐Ÿ–‹

Greg Leonard

๐Ÿ–‹

Ryan McQuen

๐Ÿ’ป

Annika

๐Ÿ‘€

Axel Viala

๐Ÿ’ป

Mohammed Sazid Al Rashid

๐Ÿ–‹ ๐Ÿ’ป

Caleb Webber

๐Ÿšง

Peter N

๐Ÿšง

seancad

๐Ÿšง

Will Hayworth

๐Ÿ–‹

Christian Zeller

๐Ÿ–‹

Jean-Francois Chevrette

๐Ÿ–‹ ๐Ÿ’ป

John Baber-Lucero

๐Ÿ–‹

Tal

๐Ÿ–‹

apogeeoak

๐Ÿ–‹ ๐Ÿ’ป

Larry Garfield

๐Ÿ–‹

This project follows the all-contributors specification. Contributions of any kind welcome!

Comments
  • meta-thread for me to use the all-contributors bot to add everyone to it

    meta-thread for me to use the all-contributors bot to add everyone to it

    I want to add https://allcontributors.org/ support, but their bot doesn't support any kind of bulk add so I have to @ people who've previously contributed explicitly here. If you get mentioned here, take it as a special thanks from me to you to help make this piece of software a bit better!

    opened by diannasoreil 100
  • arc1 seems like a giant step

    arc1 seems like a giant step

    There are several new concepts in the arc1.rs exercise, and I wonder if it would be useful to have a few gentle lead ins before this exercise.

    In particular threads are a big leap in complexity with some new syntax (closures).

    It would also be helpful to know what the arc1 code is trying to do in the first place. Reverse engineering the logic (with known missing lines of code) and figuring out threads and figuring out Arc, seems like too much for one exercise.

    opened by chrisridd 18
  • feat(intro): Proposal to add successfully compiling exercise as the first exercise.

    feat(intro): Proposal to add successfully compiling exercise as the first exercise.

    Proposal to add introductory section

    The first exercise in the section successfully compiles to acclimate new users to Rustlings and introduce the I AM NOT DONE comment.

    The second exercise simply asks the user to complete a Hello World! program.

    The intro section is more to introduce Rustlings than to teach Rust.

    opened by apogeeoak 15
  • Exercise for shared mutability between threads

    Exercise for shared mutability between threads

    Something like this, maybe:

    // Make this compile!
    
    use std::sync::Arc;
    use std::thread;
    
    struct JobStatus {
        jobs_completed: u32,
    }
    
    fn main() {
        let status = Arc::new(JobStatus { jobs_completed: 0 });
        let status_shared = status.clone();
        thread::spawn(move || {
            for _ in 0..10 {
                thread::sleep_ms(500);
                status_shared.jobs_completed += 1;
            }
        });
        while status.jobs_completed < 10 {
            println!("waiting...");
            thread::sleep_ms(1000);
        }
    }
    
    opened by jdm 15
  • errors in the installation command

    errors in the installation command

    The following error appears when installing rustlings with provided script curl -L https://git.io/rustlings | bash the rustlings executable is installed successfully tho. Please give it a check.

    =============================== Traceback (most recent call last): File "", line 1, in File "/opt/anaconda3/lib/python3.7/json/init.py", line 296, in load parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw) File "/opt/anaconda3/lib/python3.7/json/init.py", line 348, in loads return _default_decoder.decode(s) File "/opt/anaconda3/lib/python3.7/json/decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/opt/anaconda3/lib/python3.7/json/decoder.py", line 355, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0) Checking out version ... error: pathspec 'tags/' did not match any file(s) known to git

    opened by bsun0802 12
  • Refactor hints

    Refactor hints

    Breaking change. This removes hints from the end of files, and puts them into info.toml. You can now access hints using:

    rustlings hint <exerciseName>
    

    ALSO this changes the exercise system to index by name for run and hint, so:

    rustlings run exercises/if/if1.rs
    

    becomes

    rustlings run if1
    
    opened by diannasoreil 12
  • 'rustlings' is not recognized as an internal or external command, operable program or batch file.

    'rustlings' is not recognized as an internal or external command, operable program or batch file.

    I must've missed a step in installing rustlings, I am using windows 10 and ran all of the commands to install and when I ran the 'rustlings' command it seems that it doesn't know what it is. I tried editing the PATH's but it still doesn't seem to work.

    opened by ghost 11
  • feat: match exercise order to book chapters

    feat: match exercise order to book chapters

    Exercises are not organized in order for rustlings watch and it was hard to follow the exercises because we always had to jump back and forth between chapters.

    1. Updated exercise order to match that of book chapters
    2. Added exercise to book chapter mapping table to exercise README.md
    opened by JuliaCao 11
  • fix: Add a deref in the test code

    fix: Add a deref in the test code

    This change makes it possible to finish the last exercise without touching the test code, seems like an overlook when code was added since there's nothing in the hints about this extension neither.

    It's virtually impossible to write a the num_sq function to take the Box since it doesn't implement MulAssign.

    opened by aaarkid 10
  • feat: add fake manifest for analyzers/IDEs (fixes #443)

    feat: add fake manifest for analyzers/IDEs (fixes #443)

    This enables analyzers to work correctly as if the exercises folder were a true Cargo project.

    • It is an "orphan" Cargo.toml, completely unrelated to the root Cargo.toml. This has pros and cons.
      • It could be potentially confusing to learners, since they have to open the exercises folder for the analyzer to work.
      • OTOH it does not "infect" the main project build with tons of targets, many of them in a non-compilable state.
    • The folder structure is unchanged! :tada:
    opened by jrvidal 10
  • feat: Add type conversion and parsing exercises

    feat: Add type conversion and parsing exercises

    This pull request adds exercises for converting values into specific types. The exercises uses string to struct type conversions, but most of the traits in the exercises can handle more than just string parsing and conversions.

    The following traits are covered:

    1. From and Into
    2. TryFrom and TryInto
    3. AsRef
    4. FromStr

    The as operator is also covered.

    opened by AbdouSeck 10
  • fix(verify): progress bar proportion now updates with the number of files verified

    fix(verify): progress bar proportion now updates with the number of files verified

    Noticed that the percent of exercises completed did not update in the progress bar when the sub-commands verify or watch were run. The percentage would update when working through the exercises - when the loop section section of the watch routine in src/main.rs had been entered.

    Fixed the verify function in src/verify.rs so that the percentage would update by counting the number of exercises verified. A cleaner solution would be to use the percent key in the progress bar template (https://docs.rs/indicatif/latest/indicatif/index.html#templates) to implicitly change the progress percentage instead of explicitly manipulating the message to display the progress percentage. The percent key, however, does not show any digits after the decimal point (maybe another feature to implement there).

    PS. First time contributing to a public project. Please point out if there are any deficiencies in the PR.

    Thank you

    opened by cloppingemu 0
  • feat: refactored as_ref_mut.rs to as_ref.rs and as_mut1.rs and add as_mut2.rs

    feat: refactored as_ref_mut.rs to as_ref.rs and as_mut1.rs and add as_mut2.rs

    While working on exercises/conversions/as_ref_mut.rs, I thought it would be helpful to add an exercise to generalize the num_sq() function to work with any numeric type. The process of making that change gave me a better understanding of the syntax for trait bounds.

    The new exercise led to creating "as_mut2.rs", which, in turn, led to refactoring "as_ref_mut.rs" into "as_ref.rs" and "as_mut1.rs".

    Apologies in advance for bumping into Frosthage's change (https://github.com/rust-lang/rustlings/pull/1113) which updates the hint for "as_ref_mut.rs". This change incorporates the change into "as_mut1.rs" instead.

    opened by jtcours 0
  • fix(threads1): make program panic if threads are not joined

    fix(threads1): make program panic if threads are not joined

    Attempts to close #1298

    • program verifies that threads have been joined by checking if results vector has been filled
    • solution now involves recognizing that JoinHandle::join returns a Result, unpacking it, and adding the value to a vector
    opened by platformer 0
  • wrong compiler error

    wrong compiler error

    exercises > conversions > try_from_into.rs

    impl TryFrom<(i16, i16, i16)> for Color { type Error = IntoColorError; fn try_from(tuple: (i16, i16, i16)) -> Result<Self, Self::Error> { let (r, g, b) = tuple; if r < 0 || r > 255 || g < 0 || g > 255 || b < 0 || b > 255 { return Err(IntoColorError::IntConversion); } // i didn't write else yet } }

    compiler error:

    ! Compiling of exercises/conversions/try_from_into.rs failed! Please try again. Here's the output: error[E0317]: if may be missing an else clause --> exercises/conversions/try_from_into.rs:41:9 | 41 | / if r < 0 || r > 255 || g < 0 || g > 255 || b < 0 || b > 255 { 42 | | return Err(IntoColorError::IntConversion); 43 | | } | |_________^ expected (), found enum Result ( << this part ) | = note: expected unit type () found enum Result<Color, IntoColorError> = note: if expressions without else evaluate to () = help: consider adding an else block that evaluates to the expected type

    error: aborting due to previous error


    it says that it expected (), not Result.

    seems like something is wrong.

    when I write else {}, it says it expected Result and found (), and this is correct error.

    opened by cmasfo-admin 2
  • threads1 does not panick if not all handles are joined

    threads1 does not panick if not all handles are joined

    It seems to me that the panic check in exercise threads1 is incomplete.

    Here's the exercise:

    // threads1.rs
    // Execute `rustlings hint threads1` or use the `hint` watch subcommand for a hint.
    // This program should wait until all the spawned threads have finished before exiting.
    
    // I AM NOT DONE
    
    use std::thread;
    use std::time::Duration;
    
    
    fn main() {
    
        let mut handles = vec![];
        for i in 0..10 {
            thread::spawn(move || {
                thread::sleep(Duration::from_millis(250));
                println!("thread {} is complete", i);
            });
        }
    
        let mut completed_threads = 0;
        for handle in handles {
            // TODO: a struct is returned from thread::spawn, can you use it?
            completed_threads += 1;
        }
    
        if completed_threads != 10 {
            panic!("Oh no! All the spawned threads did not finish!");
        }
        
    }
    

    The solution (at least mine) is to add each thread to handles in the first loop and join each handle in the second loop like in the block below. The issue is that the panic check actually always succeeds, even if the handles are not joined. I think it should panic if some of the threads are not finished.

    // threads1.rs
    // Execute `rustlings hint threads1` or use the `hint` watch subcommand for a hint.
    // This program should wait until all the spawned threads have finished before exiting.
    
    // I AM NOT DONE
    
    use std::thread;
    use std::time::Duration;
    
    
    fn main() {
    
        let mut handles = vec![];
        for i in 0..10 {
            handles.push(thread::spawn(move || { // <- push handle to handles so you can track it
                thread::sleep(Duration::from_millis(250));
                println!("thread {} is complete", i);
            }));
        }
    
        let mut completed_threads = 0;
        for handle in handles {
            // TODO: a struct is returned from thread::spawn, can you use it?
            handle.join();          // <- code happily compiles and runs without this
            completed_threads += 1;
        }
    
        if completed_threads != 10 { // <- this condition is never met
            panic!("Oh no! All the spawned threads did not finish!");
        }
        
    }
    

    Upon trying to find how to alter the exercise I quickly discovered it's not easy to change without convoluting the whole thing, so maybe this was more of a conscious decision than a bug.

    I tried to come up with an alteration to the exercise and this is my best attempt. I don't think it's great as it introduces adding an empty result to a vector, which doesn't really make much sense.

    // threads1.rs
    // Execute `rustlings hint threads1` or use the `hint` watch subcommand for a hint.
    // This program should wait until all the spawned threads have finished before exiting.
    
    // I AM NOT DONE
    
    use std::thread;
    use std::time::Duration;
    
    
    fn main() {
    
        let mut handles = vec![];
        for i in 0..10 {
            thread::spawn(move || {
                thread::sleep(Duration::from_millis(250));
                println!("thread {} is complete", i);
            });
        }
    
        let mut results = vec![];
        for handle in handles {
            // TODO: a struct is returned from thread::spawn, can you use it?
        }
    
    
        if results.len()!= 10 {
            panic!("Oh no! All the spawned threads did not finish!");
        }
    }
    
    opened by iHnR 1
Releases(5.3.0)
  • 5.3.0(Dec 23, 2022)

  • 5.2.1(Sep 6, 2022)

  • 5.2.0(Aug 27, 2022)

  • 5.1.1(Aug 17, 2022)

  • 5.1.0(Aug 16, 2022)

    This release cleans up a bunch of the bugs left in 5.0, and adds two new smart pointer exercises. For detailed information, check the changelog.

    To upgrade:

    git fetch
    git checkout tags/5.1.0
    
    Source code(tar.gz)
    Source code(zip)
  • 5.0.0(Jul 16, 2022)

    Probably Rustlings' biggest release yet! ๐ŸŽ‰ For detailed information, check the changelog. I'll post the features section here:

    • Hint comments in exercises now also include a reference to the hint watch mode subcommand.
    • intro1: Added more hints to point the user to the source file.
    • variables: Switched variables3 and variables4.
    • Moved vec and primitive_types exercises before move_semantics.
    • Renamed vec to vecs to be more in line with the naming in general.
    • Split up the collections exercises in their own folders.
    • vec2: Added a second part of the function that provides an alternative, immutable way of modifying vec values.
    • enums3: Added a hint.
    • Moved strings before modules.
    • Added a strings3 exercise to teach modifying strings.
    • Added a hashmaps3 exercise for some advanced usage of hashmaps.
    • Moved the original quiz2 to be strings4, since it only tested strings anyways.
    • Reworked quiz2 into a new exercise that tests more chapters.
    • Renamed option to options.
    • options1: Rewrote parts of the exercise to remove the weird array iteration stuff.
    • Moved generics3 to be quiz3.
    • Moved box/arc exercises behind iterators.
    • iterators4: Added a test for factorials of zero.
    • Split threads1 between two exercises, the first one focusing more on JoinHandles.
    • Added a threads3 exercises that uses std::sync::mpsc.
    • Added a clippy3 exercises with some more interesting checks.
    • as_ref_mut: Added a section that actually tests AsMut.
    • Added 3 new lifetimes exercises.
    • Added 3 new traits exercises.

    Summary

    This release adds 12 new exercises, makes tons of little (and sometimes significant) improvements to existing exercises, rearranges a good chunk of the exercises to make more sense in our curriculum (while still trying to stay faithful to the book), and it gets rid of some exercises that have not been a good fit for this project.

    There's still a fair amount of things that I want to change, such as having better exercises for smart pointers, but that's for a future release. Feel free to post your feedback after you've completed this new version of the course!

    Special thanks for the Rust Foundation for sponsoring the majority of my work on this release!

    To upgrade:

    git fetch
    git checkout tags/5.0.0
    
    Source code(tar.gz)
    Source code(zip)
  • 4.8.0(Jul 1, 2022)

  • 4.7.1(Apr 20, 2022)

  • 4.7.0(Apr 14, 2022)

    See the changelog for what's changed. Some highlights:

    • A new intro section prefixing the normal exercises has been added.
    • New exercise, move_semantics4.
    • rust-analyzer support has been added via an optional crate feature. More info in the README
    • Tons and tons of bug fixes.

    To upgrade, run:

    git fetch
    git checkout tags/4.7.0
    
    Source code(tar.gz)
    Source code(zip)
  • 4.6.0(Sep 25, 2021)

    See the changelog for what's changed. Some highlights:

    • New exercises:
      • advanced_errs1 and advanced_errs2
      • modules3
    • try_from_into and from_str have been reworked to include custom error types.
    • Watch mode now has a quit and help command.
    • Watch mode now also shows you a nice farewell message when you exit it.

    To upgrade, run:

    git fetch
    git checkout tags/4.6.0
    
    Source code(tar.gz)
    Source code(zip)
  • 4.5.0(Jul 7, 2021)

  • 4.4.0(Apr 24, 2021)

    See the changelog for what's changed. Some highlights:

    • A lot of small and large improvements to how exercises work
    • rustlings list now displays structured data, and a takes a lot more options to filter that data:
    image
    • It also now shows you progress per-exercise, and a total summary of your completion:
    image
    • The compliation times for Rustlings should be significantly sped up, we replaced the crate we use for CLI option parsing with something more lightweight
    • Rustlings now respects the NO_EMOJI envionment variable
    • A new exercise, iterators5, has been added

    To upgrade, run:

    git fetch
    git checkout tags/4.4.0
    
    Source code(tar.gz)
    Source code(zip)
  • 4.3.0(Dec 29, 2020)

    See the changelog for what's changed. Some highlights:

    • The text you see when running rustlings (without any arguments) should now be more helpful
    • The exercise order has been adjusted to more closely match the order of chapter in the Rust book
    • A rustlings list command has been added

    To upgrade:

    git fetch
    git checkout tags/4.3.0
    
    Source code(tar.gz)
    Source code(zip)
  • 4.2.0(Nov 7, 2020)

  • 4.1.0(Oct 5, 2020)

  • 4.0.0(Jul 8, 2020)

    See the changelog for what's changed.

    The important breaking changes that make this a major release are:

    • testX.rs files have been renamed quizX.rs, due to people confusing them with the similarly-named testsX.rs exercises (which are about testing, not being tested)
    • You can now display the console output for tests using the new --nocapture option. This adds a new boolean argument to most CLI commands.

    Thanks to all of the people who contributed! A full list can be seen here, there's too many people for me to manually list here, sorry ๐Ÿ˜“

    To upgrade:

    git fetch
    git checkout tags/4.0.0
    
    Source code(tar.gz)
    Source code(zip)
  • 3.0.0(Apr 11, 2020)

    See the changelog for what's changed.

    As for what makes this a breaking release, in #278 we decided to make the compile exercise mode log its output to stdout. Since this changes existing user behaviour in a (broadly) backwards-incompatible way, we decided to make this a major release.

    The good thing is that you don't need to do anything to upgrade! ๐ŸŽ‰

    To upgrade:

    git fetch
    git checkout tags/3.0.0
    
    Source code(tar.gz)
    Source code(zip)
  • 2.2.1(Feb 27, 2020)

  • 2.2.0(Feb 25, 2020)

    This release adds a bunch of new exercises:

    • A new variables exercise (#264, thanks to @TorbenJ!)
    • Exercises about type conversion and and parsing (#249, thanks to @AbdouSeck!)
    • Trait-related exercises (#216/#274, thanks to @s-marios for the exercises and to @sjmann for rebasing them!)

    Additionally, Rustlings now displays a success message when you've finished all exercises (#253), thanks to @codehearts!

    There's a lot more, read the changelog for more details!

    To upgrade:

    git fetch
    git checkout tags/2.2.0
    

    Thanks to the following people for contributing to this release:

    • @harrisonmetz
    • @Socratides
    • @pbx
    • @sjmann
    • @quintenjohnson
    • @rahatarmanahmed
    • @dmitri-mamrukov
    • @pewsheen
    • @TorbenJ
    • @codehearts
    • @AbdouSeck
    • @gnodarse
    • @Stigjb
    • @s-marios
    Source code(tar.gz)
    Source code(zip)
  • 2.1.0(Nov 27, 2019)

  • 2.0.0(Nov 12, 2019)

  • 1.5.1(Nov 11, 2019)

  • 1.5.0(Nov 9, 2019)

  • 1.4.1(Aug 13, 2019)

  • 1.4.0(Jul 13, 2019)

  • 1.3.0(Jun 5, 2019)

    Features

    • Adds a simple exercise for structures (#163, @briankung)

    Bug Fixes

    • Add Result type signature as it is difficult for new comers to understand Generics and Error all at once. (#157, @veggiemonk)
    • Rustfmt and whitespace fixes (#161, @eddyp)
    • errorsn.rs: Separate also the hints from each other to avoid accidental viewing (#162, @eddyp)
    • fixed outdated links (#165, @gushroom)
    • Fix broken link (#164, @HanKruiger)
    • Remove highlighting and syntect (#167, @komaeda)

    To update:

    git fetch
    git checkout tags/1.3.0
    
    Source code(tar.gz)
    Source code(zip)
  • 1.2.2(May 7, 2019)

  • 1.2.1(Apr 22, 2019)

    Bug fixes

    • Fix the --nocapture feature (@komaeda)
    • Provide a nicer error message for when you're in the wrong directory

    To update:

    git fetch
    git checkout tags/1.2.1
    
    Source code(tar.gz)
    Source code(zip)
  • 1.2.0(Apr 22, 2019)

    Features

    • Add errors to exercises that compile without user changes (@yvan-sraka)
    • Use --nocapture when testing, enabling println! when running (@komaeda)
    Source code(tar.gz)
    Source code(zip)
  • 1.1.1(Apr 14, 2019)

    This release mostly contains bug fixes that, all in all, should make things much less buggy on Windows!

    Bug fixes

    • Fix permissions on exercise files (@zacanger, #133)
    • Make installation checks more thorough (@komaeda, 1b3469f236bc6979c27f6e1a04e4138a88e55de3)
    • Fix order of true/false in tests for executables (@mgeier, #137)
    • Stop run from panicking when compile fails (@cjpearce, #141)
    • Fix intermittent test failure caused by race condition (@cjpearce, #140)
    • Fix links by deleting book version (@diodfr, #142)
    • Canonicalize paths to fix path matching (@cjpearce, #143)
    Source code(tar.gz)
    Source code(zip)
Owner
The Rust Programming Language
The Rust Programming Language
Thread-safe clone-on-write container for fast concurrent writing and reading.

sync_cow Thread-safe clone-on-write container for fast concurrent writing and reading. SyncCow is a container for concurrent writing and reading of da

null 40 Jan 16, 2023
An extension to Rust std for beginner exercises

note: this is for practicing rust only, do not use this in actual production programs! really, don't. [dependencies] simple-std = "0.1.1" simple-std i

nils 2 Jan 2, 2022
WCH CH32V307 programming in Rust :crab:

WCH CH32V307 Programming in Rust ?? This is work in progress, not usable yet. Help is welcome! Resources https://github.com/r4d10n/wch-ch32v307-msc-ra

Daniel Maslowski 5 Dec 17, 2022
Code sample for "Reading files the hard way Part 3"

read-raw-ext4 Rust code sample to read an ext4 partition from Rust, for: https://fasterthanli.me/series/reading-files-the-hard-way/part-3 Usage Don't.

amos 10 Mar 25, 2023
This is the Rust course used by the Android team at Google. It provides you the material to quickly teach Rust to everyone.

Comprehensive Rust ?? This repository has the source code for Comprehensive Rust ?? , a four day Rust course developed by the Android team. The course

Google 5.2k Jan 3, 2023
A tray application for Windows that gives you push notifications and instant downloads of new posts, messages and stories posted by models you subscribe to on Onlyfans.

OF-notifier A tray application for Windows that gives you push notifications and instant downloads of new posts, messages and stories posted by models

Gentlemen Mercenary 10 Dec 20, 2022
This rust library is to get lottery monthly result loto6, numbers3 and numbers4

Scraping Japanese Lottery Site this library is to get lottery monthly result loto6, numbers3 and numbers4. scraping japanese lottery site from https:/

kubocker 5 Aug 14, 2023
A simple library to get all pairs from any Dex and sync reserves.

pair_sync A simple library to get all pairs from any supported Dex and sync reserves. Crates.io Documentation in progress Filename: examples/sync-pair

null 116 Dec 30, 2022
In this repository you can find modules with code and comments that explain rust syntax and all about Rust lang.

Learn Rust What is this? In this repository you can find modules with code and comments that explain rust syntax and all about Rust lang. This is usef

Domagoj Ratko 5 Nov 5, 2022
Simple rust interface to get derived analytical information of algorithmic market making models (M3).

af-rs Interact with the Portfolio protocol using Rust models to abstract the underlying pools. What we want: Given a uniswap pool with two tokens and

Primitive 5 Jul 11, 2023
S-expression parsing and writing in Rust

rsexp S-expression parsing and writing in Rust using nom parser combinators. This implemantion aims at being compatible with OCaml's sexplib. The main

Laurent Mazare 12 Oct 18, 2022
Tiny HTTP client for GET

tinyget a tiny fork of minreq. Simple, minimal-dependency HTTP client. Optional features for https with native-tls TLS implementations. Documentation

่ฟทๆธก 19 Dec 31, 2022
TUI (Text User Interface) - Get Instant feedback for your sh commands

Bashtastic Visualizer TUI (Text User Interface) - Get Instant feedback for your sh commands. Explore and play with your queries ??. The idea of this p

Alfredo Suarez 7 Nov 26, 2023
๐Ÿ•ถ Assorted checks and validations for writing safer Solana programs.

vipers ?? Assorted checks and validations for writing safer Solana programs. Motivation Solana's fee mechanism is unlike Ethereum's, in that the numbe

Saber 131 Sep 14, 2022
TypeRust - simple Rust playground where you can build or run your Rust code and share it with others

Rust playground Welcome to TypeRust! This is a simple Rust playground where you can build or run your Rust code and share it with others. There are a

Kirill Vasiltsov 28 Dec 12, 2022
A webapp that reads your articles to you while you're on the subway

ReadToMyShoe Video Demo A website that reads articles to you, even when you're offline. Still in early development. This is a full-stack Rust webapp,

Michael Rosenberg 20 Dec 10, 2022
Rust ๆ ธๅฟƒๅบ“ๅ’Œๆ ‡ๅ‡†ๅบ“็š„ๆบ็ ็บงไธญๆ–‡็ฟป่ฏ‘๏ผŒๅฏไฝœไธบ IDE ๅทฅๅ…ท็š„ๆ™บ่ƒฝๆ็คบ (Rust core library and standard library translation. can be used as IntelliSense for IDE tools)

Rust ๆ ‡ๅ‡†ๅบ“ไธญๆ–‡็‰ˆ ่ฟ™ๆ˜ฏ็ฟป่ฏ‘ Rust ๅบ“ ็š„ๅœฐๆ–น๏ผŒ ็›ธๅ…ณๆบไปฃ็ ๆฅ่‡ชไบŽ https://github.com/rust-lang/rustใ€‚ ๅฆ‚ๆžœๆ‚จไธไผš่ฏด่‹ฑ่ฏญ๏ผŒ้‚ฃไนˆๆ‹ฅๆœ‰ไฝฟ็”จไธญๆ–‡็š„ๆ–‡ๆกฃ่‡ณๅ…ณ้‡่ฆ๏ผŒๅณไฝฟๆ‚จไผš่ฏด่‹ฑ่ฏญ๏ผŒไฝฟ็”จๆฏ่ฏญไนŸไป็„ถ่ƒฝ่ฎฉๆ‚จๆ„Ÿๅˆฐๆ„‰ๅฟซใ€‚Rust ๆ ‡ๅ‡†ๅบ“ๆ˜ฏ้ซ˜่ดจ้‡็š„๏ผŒไธ็ฎกๆ˜ฏๆ–ฐๆ‰‹่ฟ˜ๆ˜ฏ่€ๆ‰‹๏ผŒ้ƒฝๅฏไปฅไปŽไธญ

wtklbm 493 Jan 4, 2023
A Rust macro for writing nested loop expressions

loop_chain A Rust macro for writing nested loop expressions Usage | Examples | Docs Dependencies [dependencies] loop_chain = "0.1.1" Usage For express

Takayuki Maeda 5 Jul 30, 2021
Take your first step in writing a compiler. Implemented in Rust.

first-step-rust Take your first step in writing a compiler, using Rust. Building from Source Make sure the Rust toolchain is installed on your compute

PKU Compiler Course 13 Aug 28, 2022