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.
This commit is contained in:
Yudhiesh Ravindranath 2020-09-24 12:27:32 +08:00 committed by GitHub
parent a75300b8c7
commit d183d8cf34
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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));