From 611306a1720c9dedf69fb7135cda7a1bb0a4f539 Mon Sep 17 00:00:00 2001 From: Nicole L Date: Fri, 28 Feb 2025 11:31:36 -0800 Subject: [PATCH] Add speaker note about UFCS (#2672) --- src/methods-and-traits/methods.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/methods-and-traits/methods.md b/src/methods-and-traits/methods.md index 974ed3c4..9c8386ae 100644 --- a/src/methods-and-traits/methods.md +++ b/src/methods-and-traits/methods.md @@ -77,6 +77,8 @@ Key Points: - Developers may choose to use methods to take advantage of method receiver syntax and to help keep them more organized. By using methods we can keep all the implementation code in one predictable place. + - Note that methods can also be called like associated functions by explicitly + passing the receiver in, e.g. `CarRace::add_lap(&mut race, 20)`. - Point out the use of the keyword `self`, a method receiver. - Show that it is an abbreviated term for `self: Self` and perhaps show how the struct name could also be used.