Skip to content

Commit e604382

Browse files
committed
Explain why &self is common
Fixes #23748
1 parent 242ed0b commit e604382

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/doc/trpl/method-syntax.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ You can think of this first parameter as being the `x` in `x.foo()`. The three
5151
variants correspond to the three kinds of thing `x` could be: `self` if it's
5252
just a value on the stack, `&self` if it's a reference, and `&mut self` if it's
5353
a mutable reference. We should default to using `&self`, as it's the most
54-
common. Here's an example of all three variants:
54+
common, as Rustaceans prefer borrowing over taking ownership, and references
55+
over mutable references. Here's an example of all three variants:
5556

5657
```rust
5758
struct Circle {

0 commit comments

Comments
 (0)