1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2025-07-05 06:00:30 +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:
Nicole L
2025-06-26 12:07:50 -07:00
committed by GitHub
parent da28a502bf
commit 39d0588c89

View File

@ -22,6 +22,7 @@ impl Pet for Dog {
fn main() {
let fido = Dog { name: String::from("Fido"), age: 5 };
dbg!(fido.talk());
fido.greet();
}
```