Skip to content

Commit 611306a

Browse files
authored
Add speaker note about UFCS (#2672)
1 parent 526dddc commit 611306a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/methods-and-traits/methods.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@ Key Points:
7777
- Developers may choose to use methods to take advantage of method receiver
7878
syntax and to help keep them more organized. By using methods we can keep
7979
all the implementation code in one predictable place.
80+
- Note that methods can also be called like associated functions by explicitly
81+
passing the receiver in, e.g. `CarRace::add_lap(&mut race, 20)`.
8082
- Point out the use of the keyword `self`, a method receiver.
8183
- Show that it is an abbreviated term for `self: Self` and perhaps show how
8284
the struct name could also be used.

0 commit comments

Comments
 (0)