From da86f50ab827eef2130fc7b8aa1eae947ab78aa3 Mon Sep 17 00:00:00 2001 From: Corey Farwell Date: Fri, 29 Jul 2016 22:53:54 -0400 Subject: [PATCH] Don't use UFCS before it gets introduced. It's not introduced until later in this page. --- src/ch05-02-method-syntax.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/ch05-02-method-syntax.md b/src/ch05-02-method-syntax.md index 89e8ba354..ef4cb6ac6 100644 --- a/src/ch05-02-method-syntax.md +++ b/src/ch05-02-method-syntax.md @@ -189,7 +189,7 @@ reference. Yet, we needed a `&` for `p2` but not `p1`. What gives? This feature is called ‘automatic referencing’, and calling methods is one of the few places in Rust that has behavior like this. Here’s how it works: when you call a method with `self.(`, Rust will automatically add in `&`s -or `&mut`s to match the signature. In other words, these three are the same: +or `&mut`s to match the signature. In other words, these are the same: ```rust # #[derive(Debug,Copy,Clone)] @@ -210,7 +210,6 @@ or `&mut`s to match the signature. In other words, these three are the same: # let p2 = Point { x: 5.0, y: 6.5 }; p1.distance(&p2); (&p1).distance(&p2); -Point::distance(&p1, &p2); ``` The first one looks much, much cleaner. Here’s another example: