Compare commits

...

8 commits

Author SHA1 Message Date
mo8it dc5c72bc19 Update README.md 2024-04-26 03:44:16 +02:00
mo8it 0ce5d9d4d7 Update README.md 2024-04-26 03:39:38 +02:00
mo8it 37fcbeb596 Add indentation for details 2024-04-26 03:29:05 +02:00
mo8it 2f071c97b0 Update README.md 2024-04-26 03:25:31 +02:00
mo8it 9664f4357c Use HTML in the summary 2024-04-26 03:20:34 +02:00
mo8it 74ae506603 Update README 2024-04-26 03:17:35 +02:00
mo8it 2965867338 Add click to expand 2024-04-26 02:02:14 +02:00
mo8it e63e668d86 Use <details> 2024-04-26 02:00:42 +02:00

View file

@ -21,9 +21,12 @@ Before installing Rustlings, you need to have _Rust installed_.
Visit [www.rust-lang.org/tools/install](https://www.rust-lang.org/tools/install) for further instructions on installing Rust.
This'll also install _Cargo_, Rust's package/project manager.
🐧 If you're on Linux, make sure you've installed `gcc` (for a linker). Deb: `sudo apt install build-essential gcc`. Dnf: `sudo dnf install gcc`.
> 🐧 If you're on Linux, make sure you've installed `gcc` (for a linker).
>
> Deb: `sudo apt install gcc`.
> Dnf: `sudo dnf install gcc`.
🍎 If you're on MacOS, make sure you've installed Xcode and its developer tools by typing `xcode-select --install`.
> 🍎 If you're on MacOS, make sure you've installed Xcode and its developer tools by running `xcode-select --install`.
### Installing Rustlings
@ -35,15 +38,16 @@ The following command will download and compile Rustlings:
cargo install rustlings@6.0.0-beta.3
```
#### Troubleshooting
If the installation fails…
<details>
<summary><strong>If the installation fails…</strong> (<em>click to expand</em>)</summary>
<!-- TODO: Remove @6.0.0-beta.x -->
- Make sure you have the latest Rust version by running `rustup update`.
- Try adding the `--locked` flag: `cargo install rustlings --locked`
- Otherwise, please [report an issue](https://github.com/rust-lang/rustlings/issues/new).
- Make sure you have the latest Rust version by running `rustup update`
- Try adding the `--locked` flag: `cargo install rustlings@6.0.0-beta.3 --locked`
- Otherwise, please [report the issue](https://github.com/rust-lang/rustlings/issues/new)
</details>
### Initialization
@ -53,7 +57,7 @@ After installing Rustlings, run the following command to initialize the `rustlin
rustlings init
```
Now, go into the newly initialized directory and run Rustlings for further instructions on getting started with the exercises:
Now, go into the newly initialized directory and launch Rustlings for further instructions on getting started with the exercises:
```bash
cd rustlings/
@ -62,45 +66,40 @@ rustlings
## 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 exercises are sorted by topic and can be found in the subdirectory `exercises/<topic>`.
For every topic, there is an additional `README.md` file with some resources to get you started on the topic.
We highly 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:
Some exercises contain tests that need to pass for the exercise to be done ✅
```bash
rustlings
```
### Watch Mode
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.
After [initialization](#initialization), Rustlings can be launched by simply running the command `rustlings`.
In case you want to go by your own order, or want to only verify a single exercise, you can run:
This will start the _watch mode_ which walks you through the exercises in a predefined order (what we think is best for newcomers).
It will rerun the current exercise automatically every time you change the exercise's file in the `exercises/` directory.
```bash
rustlings run EXERCISE_NAME
```
<details>
<summary><strong>If detecting file changes in the <code>exercises/</code> directory fails…</strong> (<em>click to expand</em>)</summary>
Or simply use the following command to run the next pending exercise in the course:
> You can add the **`--manual-run`** flag (`rustlings --manual-run`) to manually rerun the current exercise by entering `r` or `run` in the watch mode.
>
> Please [report the issue](https://github.com/rust-lang/rustlings/issues/new) with some information about your operating system and whether you run Rustlings in a container or virtual machine (e.g. WSL).
```bash
rustlings run
```
</details>
In case you get stuck, you can run the following command to get a hint for your exercise:
### Exercise List
```bash
rustlings hint EXERCISE_NAME
```
In the [watch mode](#watch-mode) (after launching `rustlings`), you can enter `l` or `list` to open the interactive exercise list.
You can also get the hint for the next pending exercise with the following command:
The list allows you to…
```bash
rustlings hint
```
- See the status of all exercises (done or pending)
- `c`: Continue at another exercise (temporarily skip some exercises or go back to a previous one)
- `r`: Reset status and file of an exercise (you need to _reload/reopen_ its file in your editor afterwards)
See the footer of the list for all possible keys.
## Continuing On
@ -111,25 +110,15 @@ Continue practicing your Rust skills by building your own projects, contributing
## Uninstalling Rustlings
If you want to remove Rustlings from your system, there are two steps.
1️⃣ Remove the `rustlings` directory that was created by `rustlings init`:
```bash
rm -r rustlings
```
2️⃣ Run `cargo uninstall` to remove the `rustlings` binary:
If you want to remove Rustlings from your system, run the following command:
```bash
cargo uninstall rustlings
```
That's it!
## Contributing
See [CONTRIBUTING.md](https://github.com/rust-lang/rustlings/blob/main/CONTRIBUTING.md).
See [CONTRIBUTING.md](https://github.com/rust-lang/rustlings/blob/main/CONTRIBUTING.md) 🔗
## Contributors ✨