From d183d8cf34a633e0ca9baea0cd64c8dc91b68a0e Mon Sep 17 00:00:00 2001 From: Yudhiesh Ravindranath Date: Thu, 24 Sep 2020 12:27:32 +0800 Subject: [PATCH] Remove type when passing in a struct to an enum I was doing this exercise and noticed that the default test had an issue where it was defining the type being passed to the enum as a struct. Test was failing and the compiler advised to remove the type of Point. When it was removed test ran successfully. --- exercises/enums/enums3.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/enums/enums3.rs b/exercises/enums/enums3.rs index 178b40c..390246b 100644 --- a/exercises/enums/enums3.rs +++ b/exercises/enums/enums3.rs @@ -53,7 +53,7 @@ mod tests { }; state.process(Message::ChangeColor((255, 0, 255))); state.process(Message::Echo(String::from("hello world"))); - state.process(Message::Move(Point { x: 10, y: 15 })); + state.process(Message::Move { x: 10, y: 15 }); state.process(Message::Quit); assert_eq!(state.color, (255, 0, 255));