From c981fc35590bbf754138bce4ee6fab7bf5393f43 Mon Sep 17 00:00:00 2001 From: Steve Klabnik Date: Sat, 30 Jul 2016 20:45:16 +0000 Subject: [PATCH] rebuild pages at 830db27 --- ch05-02-method-syntax.html | 3 ++- print.html | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ch05-02-method-syntax.html b/ch05-02-method-syntax.html index b61af0c0a..71555b03a 100644 --- a/ch05-02-method-syntax.html +++ b/ch05-02-method-syntax.html @@ -222,7 +222,7 @@ reference. Yet, we needed a & for p2 but not 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 &muts to match the signature. In other words, these are the same:

+or &muts to match the signature. In other words, these three are the same:

# #[derive(Debug,Copy,Clone)]
 # struct Point {
 #     x: f64,
@@ -241,6 +241,7 @@ or &muts to match the signature. In other words, these are the
 # 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:

let mut s = String::from("Hello,");
diff --git a/print.html b/print.html
index 1e2a64636..6b4ad366f 100644
--- a/print.html
+++ b/print.html
@@ -2950,7 +2950,7 @@ reference. Yet, we needed a & for p2 but not 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 &muts to match the signature. In other words, these are the same:

+or &muts to match the signature. In other words, these three are the same:

# #[derive(Debug,Copy,Clone)]
 # struct Point {
 #     x: f64,
@@ -2969,6 +2969,7 @@ or &muts to match the signature. In other words, these are the
 # 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:

let mut s = String::from("Hello,");