From 704d2691600bcdb1c44b6582dbee5e468020be9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=B6khan=20=C5=9Eim=C5=9Fek?= Date: Sat, 23 Dec 2023 19:42:16 +0300 Subject: [PATCH] Minor change --- src/match_.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/match_.rs b/src/match_.rs index 69006a6..10fa520 100644 --- a/src/match_.rs +++ b/src/match_.rs @@ -63,8 +63,12 @@ struct Point { x: i32, y: i32 } #[test] fn ex_4_a() { let p = Point { x: 0, y: 7 }; let Point { x: a, y: b } = p; - assert_eq!(0, a); - assert_eq!(7, b); + assert_eq!(a, 0); + assert_eq!(b, 7); + // or simpler + let Point { x, y } = p; + assert_eq!(x, 0); + assert_eq!(y, 7); match p { Point { x, y: 0 } => println!("x is any, y is 0"),