You've already forked comprehensive-rust
mirror of
https://github.com/google/comprehensive-rust.git
synced 2025-07-03 13:29:52 +02:00
Add direct call to talk
in trait implementation slide (#2787)
I think it'd be helpful to also show a direct call to `talk`, so that it's clear that both trait methods can be called directly.
This commit is contained in:
@ -22,6 +22,7 @@ impl Pet for Dog {
|
||||
|
||||
fn main() {
|
||||
let fido = Dog { name: String::from("Fido"), age: 5 };
|
||||
dbg!(fido.talk());
|
||||
fido.greet();
|
||||
}
|
||||
```
|
||||
|
Reference in New Issue
Block a user