From bde6f7470c651c1d608eda6a18940b092a982184 Mon Sep 17 00:00:00 2001 From: mo8it Date: Sat, 28 Dec 2024 16:46:24 +0100 Subject: [PATCH] Co-ordinates -> Coordinates --- exercises/12_options/options3.rs | 2 +- solutions/12_options/options3.rs | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/exercises/12_options/options3.rs b/exercises/12_options/options3.rs index 4cedb512..c97b1d3c 100644 --- a/exercises/12_options/options3.rs +++ b/exercises/12_options/options3.rs @@ -9,7 +9,7 @@ fn main() { // TODO: Fix the compiler error by adding something to this match statement. match optional_point { - Some(p) => println!("Co-ordinates are {},{}", p.x, p.y), + Some(p) => println!("Coordinates are {},{}", p.x, p.y), _ => panic!("No match!"), } diff --git a/solutions/12_options/options3.rs b/solutions/12_options/options3.rs index 0081eeb2..c918f711 100644 --- a/solutions/12_options/options3.rs +++ b/solutions/12_options/options3.rs @@ -10,7 +10,7 @@ fn main() { // Solution 1: Matching over the `Option` (not `&Option`) but without moving // out of the `Some` variant. match optional_point { - Some(ref p) => println!("Co-ordinates are {},{}", p.x, p.y), + Some(ref p) => println!("Coordinates are {},{}", p.x, p.y), // ^^^ added _ => panic!("No match!"), } @@ -18,7 +18,8 @@ fn main() { // Solution 2: Matching over a reference (`&Option`) by added `&` before // `optional_point`. match &optional_point { - Some(p) => println!("Co-ordinates are {},{}", p.x, p.y), + //^ added + Some(p) => println!("Coordinates are {},{}", p.x, p.y), _ => panic!("No match!"), }