Skip to content

Commit bde6f74

Browse files
committed
Co-ordinates -> Coordinates
1 parent 53ec59e commit bde6f74

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

exercises/12_options/options3.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ fn main() {
99

1010
// TODO: Fix the compiler error by adding something to this match statement.
1111
match optional_point {
12-
Some(p) => println!("Co-ordinates are {},{}", p.x, p.y),
12+
Some(p) => println!("Coordinates are {},{}", p.x, p.y),
1313
_ => panic!("No match!"),
1414
}
1515

solutions/12_options/options3.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,16 @@ fn main() {
1010
// Solution 1: Matching over the `Option` (not `&Option`) but without moving
1111
// out of the `Some` variant.
1212
match optional_point {
13-
Some(ref p) => println!("Co-ordinates are {},{}", p.x, p.y),
13+
Some(ref p) => println!("Coordinates are {},{}", p.x, p.y),
1414
// ^^^ added
1515
_ => panic!("No match!"),
1616
}
1717

1818
// Solution 2: Matching over a reference (`&Option`) by added `&` before
1919
// `optional_point`.
2020
match &optional_point {
21-
Some(p) => println!("Co-ordinates are {},{}", p.x, p.y),
21+
//^ added
22+
Some(p) => println!("Coordinates are {},{}", p.x, p.y),
2223
_ => panic!("No match!"),
2324
}
2425

0 commit comments

Comments
 (0)