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