From f72a9f7b69334b5d2566d221ef522094ac46b228 Mon Sep 17 00:00:00 2001 From: "Carol (Nichols || Goulding)" Date: Mon, 26 Sep 2016 18:47:51 -0400 Subject: [PATCH] Ooops this was wrong --- src/ch05-01-method-syntax.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ch05-01-method-syntax.md b/src/ch05-01-method-syntax.md index 1c17026..1ef77ae 100644 --- a/src/ch05-01-method-syntax.md +++ b/src/ch05-01-method-syntax.md @@ -46,7 +46,7 @@ body. Then in `main` where we called the `area` function and passed `rect1` as an argument, we can instead use *method syntax* to call the `area` method on our `Rectangle` instance. -In the signature for `area`, we get to use `self` instead of `rectangle: +In the signature for `area`, we get to use `&self` instead of `rectangle: &Rectangle` because Rust knows the type of `self` is `Rectangle` due to this method being inside the `impl Rectangle` context. Note we still need to have the `&` before `self`, just like we had `&Rectangle`. Methods can choose to