1. 1
    Setup Rustlings
    1m 44s

Setup Rustlings

Chris Biscardi
InstructorChris Biscardi
Share this video with your friends

Social Share Links

Send Tweet
Published 4 years ago
Updated 2 weeks ago

Set up for Rust exercises.

Chris Biscardi: [0:00] If you're just getting started with Rust, and you want to learn a little bit more, get your hands on some code, not get too deep, don't do any huge projects or anything like that. There's this free book called "Rustlings" that will let you take a bunch of small exercises that have a bunch of tests written for them, and get you used to reading and writing Rust code.

[0:18] Now, I'm on MacOS. I'm going to copy and paste the cURL command which will download a script, and pipe it to bash which runs it. After we run the script, if you see this message at the end, that means everything worked, and you don't have to do anything else.

[0:31] Note that this script checks for Git, Rust, Cargo, and some other things. I already have all these tools installed, so I don't need to do anything else. We can cd into the rustlings directory. Inside of this directory, you'll see an installed.sh and a number of other things. Really, the only directory we care about is exercises. This includes all the exercises that we'll end up doing.

[0:52] The cURL command we ran before installed a CLI tool for us. The CLI tool is called rustlings. If we run rustlings watch, we can see an error. This error is in the exercises/variables/variables1.rs file.

[1:09] As we work through these exercises, you'll note that we'll first see an error in a particular file. We'll fix the error, and then it'll move on to the next file. In this way we can use rustlings watch to go through the entire rustlings repo.

[1:23] Note that you can also use the rustlings run to run specific exercises, get hints, or verify them. Finally, note that the version of rustlings that we are going to use includes a couple of exercises that aren't necessarily included in watch, or aren't necessarily ready for people to do, or aren't documented enough. Those are listed here. Let's get started.

Quang Le
Quang Le
~ 3 years ago

Hi Chris, I am not sure which git link I should follow? Either from rust-lang/rustlings or your github account, the rustling watch does not follow the order of files as in your video. Would you please advise? Thanks

Lucas Minter
Lucas Minter
~ 3 years ago

Hi Chris, I am not sure which git link I should follow? Either from rust-lang/rustlings or your github account, the rustling watch does not follow the order of files as in your video. Would you please advise? Thanks

I would follow along with Chris' repository for this course.

Quang Le
Quang Le
~ 3 years ago

Thanks @Lucas Minter, do you see the order of the watch is the same with lecture videos after Variable section? If so which branch or tag do you use?

Chris Biscardi
Chris Biscardiinstructor
~ 3 years ago

Hey y'all!

The Rustlings repository has released a major new version since this course was released. If you want to follow along exactly you can use the repo under my username and follow the master branch: https://github.com/ChristopherBiscardi/rustlings/tree/master or if you're comfortable using a slightly bigger set of exercises you can follow the Rustlings core repo. The majority of the exercises are the same, but some things may look different.

Quang Le
Quang Le
~ 3 years ago

Thanks Chris for the instructions.

Markdown supported.
Become a member to join the discussionEnroll Today