mirror of
https://github.com/rust-lang/rustlings.git
synced 2026-01-10 12:49:18 +00:00
go
This commit is contained in:
parent
f1843c5040
commit
412c08af5b
@ -17,11 +17,9 @@ enum Message {
|
||||
|
||||
impl Message {
|
||||
fn call(&self) {
|
||||
println!("{:?}", &self.Quit);
|
||||
}
|
||||
fn test(&self) {
|
||||
println!("{:?}",self.Echo );
|
||||
println!("{:?}", &self);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
fn main() {
|
||||
@ -31,8 +29,7 @@ fn main() {
|
||||
Message::ChangeColor(200, 255, 255),
|
||||
Message::Quit,
|
||||
];
|
||||
let t=Message::Echo(String::from("test"));
|
||||
t.test();
|
||||
|
||||
for message in &messages {
|
||||
message.call();
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user