Skip to content

Commit 9923afe

Browse files
romain-at-adacoreDana Binkley
authored andcommitted
Update from MR comments
1 parent 6b59263 commit 9923afe

4 files changed

Lines changed: 11 additions & 13 deletions

File tree

courses/rust_essentials/080_pattern_matching/lab/answer/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[package]
2-
name = "lab"
2+
name = "answer"
33
version = "1.0.0"
44
edition = "2024"
55

courses/rust_essentials/080_pattern_matching/lab/answer/src/main.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@
33
//!
44
#[allow(dead_code)]
55
#[allow(unused_variables)]
6-
76
fn main() {
87

9-
// TASK 1 - Exhaustiveness in `match`
8+
// TASK 1 - Exhaustiveness in 'match'
109
// Hint: All possible cases must be handled
1110
enum Status {
1211
Online,
@@ -23,7 +22,7 @@ fn main() {
2322
}
2423

2524

26-
// TASK 2 - Refutable Pattern in a `let` Binding
25+
// TASK 2 - Refutable Pattern in a 'let' Binding
2726
// Hint: Every `let` binding uses a pattern, but simple bindings require irrefutable patterns
2827
let secret_value = Some(42);
2928

@@ -73,7 +72,7 @@ fn main() {
7372

7473

7574
// TASK 6 - Longhand Struct Destructuring and Renaming
76-
// Hint: Use `field: variable` to rename data as it is extracted
75+
// Hint: Use 'field: variable' to rename data as it is extracted
7776
struct Coordinates {
7877
x: i32,
7978
y: i32,
@@ -94,7 +93,7 @@ fn main() {
9493

9594
let geo = Geometry::Rectangle { width: 10, height: 20 };
9695
match geo {
97-
// Fix: Changed the tuple syntax `()` to struct syntax `{}`
96+
// Fix: Changed the tuple syntax '()' to struct syntax '{}'
9897
Geometry::Rectangle { width, height } => println!("{}x{}", width, height),
9998
}
10099

@@ -110,7 +109,7 @@ fn main() {
110109

111110

112111
// TASK 9 - Variable Bindings with Ranges
113-
// Hint: Use the `@` operator to give a name to a value while checking it against a range
112+
// Hint: Use the '@' operator to give a name to a value while checking it against a range
114113
let dice_roll = 4;
115114
match dice_roll {
116115
// Fix: Placed the identifier `roll` before the `@` and the range pattern

courses/rust_essentials/080_pattern_matching/lab/prompt/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[package]
2-
name = "lab"
2+
name = "prompt"
33
version = "1.0.0"
44
edition = "2024"
55

courses/rust_essentials/080_pattern_matching/lab/prompt/src/main.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,9 @@
55
//!
66
#[allow(dead_code)]
77
#[allow(unused_variables)]
8-
98
fn main() {
109

11-
// TASK 1 - Exhaustiveness in `match`
10+
// TASK 1 - Exhaustiveness in 'match'
1211
// Hint: All possible cases must be handled
1312
enum Status {
1413
Online,
@@ -23,7 +22,7 @@ fn main() {
2322
}
2423

2524

26-
// TASK 2 - Refutable Pattern in a `let` Binding
25+
// TASK 2 - Refutable Pattern in a 'let' Binding
2726
// Hint: Every `let` binding uses a pattern, but simple bindings require irrefutable patterns
2827
let secret_value = Some(42);
2928

@@ -68,7 +67,7 @@ fn main() {
6867

6968

7069
// TASK 6 - Longhand Struct Destructuring and Renaming
71-
// Hint: Use `field: variable` to rename data as it is extracted
70+
// Hint: Use 'field: variable' to rename data as it is extracted
7271
struct Coordinates {
7372
x: i32,
7473
y: i32,
@@ -102,7 +101,7 @@ fn main() {
102101

103102

104103
// TASK 9 - Variable Bindings with Ranges
105-
// Hint: Use the `@` operator to give a name to a value while checking it against a range
104+
// Hint: Use the '@' operator to give a name to a value while checking it against a range
106105
let dice_roll = 4;
107106
match dice_roll {
108107
1..=6 @ roll => println!("Rolled a {}", roll),

0 commit comments

Comments
 (0)