enums done

This commit is contained in:
blacktoast 2021-10-12 05:23:42 +00:00
parent 8654e318a7
commit ef264b86e4

View File

@ -1,7 +1,6 @@
// enums3.rs // enums3.rs
// Address all the TODOs to make the tests pass! // Address all the TODOs to make the tests pass!
// I AM NOT DONE
#[derive(Debug)] #[derive(Debug)]
enum Message { enum Message {
// TODO: implement the message variant types based on their usage below // TODO: implement the message variant types based on their usage below
@ -49,7 +48,9 @@ impl State {
Message::ChangeColor((a,b,c))=>{ Message::ChangeColor((a,b,c))=>{
self.color=(a,b,c); self.color=(a,b,c);
}, },
Message::Move(Point)=>(), Message::Move(Point)=>{self.position=Point;},
Message::Echo(str)=>{println!("{}",str);},
Message::Quit=>{self.quit=true;},
_=>(), _=>(),
} }
} }