Skip to content

Add async-await exercises#2413

Closed
chrischiedo wants to merge 2 commits into
rust-lang:mainfrom
chrischiedo:async-await-exercises
Closed

Add async-await exercises#2413
chrischiedo wants to merge 2 commits into
rust-lang:mainfrom
chrischiedo:async-await-exercises

Conversation

@chrischiedo

Copy link
Copy Markdown

TL;DR: This PR adds 4 new exercises on async-await to Rustlings.

Motivation: Rustlings was super helpful in my journey of understanding Rust early on. I first solved the exercises about four years ago (version@5.0.0). I recently went through the exercises again (mainly curious to see what had changed). What stood out for me was how easy it is to get started with the exercises now (cargo install rustlings). But, I also realized that we didn't have exercises on async-await. The 3rd edition of The Rust Programming Book has a new chapter on Async Programming, and I thought it'd be great for us to have some exercises on Rustlings covering this new chapter.

Challenge (and potential solution): Rust doesn't ship with an async runtime in the standard library. And so far, Rustlings doesn't have any external dependencies (it tries to stick to the standard library as much as possible). Fortunately, the authors of the Book have created the trpl crate that re-exports some of the important functionalities provided by Tokio, the popular async runtime for Rust.

Things to note:

  • these exercises on async-await required the addition of an external dependency (the trpl crate). This allows us to use the Tokio runtime under the hood.
# file: dev/Cargo.toml

[dependencies]
trpl = "0.3.0"  # current version of the crate
  • async-await is a challenging topic (both in Rust, and in general). I've tried to add simple and (hopefully) clear exercises that assesses a learner's understanding of material in the Async chapter of the Book. Any form of feedback and/or suggestion(s) is highly welcome!

@mo8it

mo8it commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

We didn't ask for AI generated exercises. @senekor is working on a set of exercises for the new version.

@mo8it mo8it closed this Jun 18, 2026
@chrischiedo chrischiedo deleted the async-await-exercises branch June 18, 2026 08:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants