1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2025-07-04 21:58:46 +02:00
This commit is contained in:
Pavel Roskin
2023-12-20 10:21:54 -08:00
committed by GitHub
parent cf81b7a88d
commit 30f8e50b43
5 changed files with 5 additions and 5 deletions

View File

@ -36,7 +36,7 @@ Discussion points:
call site.
* Why is `Output` an associated type? Could it be made a type parameter of the method?
* Short answer: Function type parameters are controlled by the caller, but
associated types (like `Output`) are controlled by the implementor of a
associated types (like `Output`) are controlled by the implementer of a
trait.
* You could implement `Add` for two different types, e.g.
`impl Add<(i32, i32)> for Point` would add a tuple to a `Point`.