rustlings

Rustlings 6.0.0

v6.0.0 Jul 3 2024 at 13:43 UTC

This release is the result of a complete rewrite to deliver a ton of new features and improvements ✨ The most important changes are highlighted below.

Installation

The installation has been simplified a lot! To install Rustlings after installing Rust, all what you need to do now is running the following command:

cargo install rustlings

Yes, this means that Rustlings is now on crates.io 🎉

You can read about the motivations of this change in this issue.

UI/UX

  • The UI is now responsive when the terminal is resized.
  • The progress bar was moved to the bottom so that you can always see your progress and the current exercise to work on.
  • The current exercise path is now a terminal link. It will open the exercise file in your default editor when you click on it.
  • A small prompt is now always shown at the bottom. It allows you to choose an action by entering a character. For example, entering h will show you the hint of the current exercise.
  • The comment "I AM NOT DONE!" doesn't exist anymore. Instead of needing to remove it to go to the next exercise, you need to enter n in the terminal.

List mode

A list mode was added using Ratatui. You can enter it by entering l in the watch mode. It offers the following features:

  • Browse all exercises and see their state (pending/done).
  • Filter exercises based on their state (pending/done).
  • Continue at another exercise. This allows you to skip some exercises or go back to previous ones.
  • Reset an exercise so you can start over and revert your changes.

Solutions

After finishing an exercise, a solution file will be available and Rustlings will show you its path in green. This allows you to compare your solution with an idiomatic solution and maybe learn about other ways to solve a problem.

While writing the solutions, all exercises have been polished 🌟 For example, every exercise now contains TODO comments to highlight what the user needs to change and where.

LSP support out of the box

Instead of creating a project.json file using rustlings lsp, Rustlings now works with a Cargo.toml file out of the box. No actions are needed to activate the language server rust-analyzer.

This should avoid issues related to the language server or to running exercises, especially the ones with Clippy.

Clippy

Clippy lints are now shown on all exercises, not only the Clippy exercises 📎 Make Clippy your friend from early on 🥰

Third-party exercises

Rustlings now supports third-party exercises!

Do you want to create your own set of Rustlings exercises to focus on some specific topic? Or do you want to translate the original Rustlings exercises? Then follow the link to the guide about third-party exercises!