mirror of
https://github.com/KaiserY/trpl-zh-cn
synced 2025-02-24 13:22:19 +08:00
32 lines
406 B
Rust
Executable File
32 lines
406 B
Rust
Executable File
// ANCHOR: here
|
|
trait Pilot {
|
|
fn fly(&self);
|
|
}
|
|
|
|
trait Wizard {
|
|
fn fly(&self);
|
|
}
|
|
|
|
struct Human;
|
|
|
|
impl Pilot for Human {
|
|
fn fly(&self) {
|
|
println!("This is your captain speaking.");
|
|
}
|
|
}
|
|
|
|
impl Wizard for Human {
|
|
fn fly(&self) {
|
|
println!("Up!");
|
|
}
|
|
}
|
|
|
|
impl Human {
|
|
fn fly(&self) {
|
|
println!("*waving arms furiously*");
|
|
}
|
|
}
|
|
// ANCHOR_END: here
|
|
|
|
fn main() {}
|