1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2025-09-16 17:46:35 +02:00

Introduce 'Idiomatic Rust' learning module (#2800)

This PR introduces:

- A new section for the "Idiomatic Rust" learning module
- (The beginning of) the section on newtype patterns

---------

Co-authored-by: Dmitri Gribenko <gribozavr@gmail.com>
This commit is contained in:
Luca Palmieri
2025-07-09 21:03:41 +02:00
committed by GitHub
parent c2ffbd7f5b
commit 4483602cd2
10 changed files with 425 additions and 1 deletions

View File

@@ -48,7 +48,8 @@ pub fn replace(
["course", "outline"] if course.is_some() => {
course.unwrap().schedule()
}
["course", "outline", course_name] => {
["course", "outline", course_name @ ..] => {
let course_name = course_name.join(" ");
let Some(course) = courses.find_course(course_name) else {
return format!("not found - {}", captures[0].to_string());
};