Skip to content

Commit 6ef577b

Browse files
Rust does automatically takes a reference, sometimes (#2718)
fix #2694
1 parent d6fbd21 commit 6ef577b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/references/shared.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ value.
3939
will recognize references as pointers. Later parts of the course will cover
4040
how Rust prevents the memory-safety bugs that come from using raw pointers.
4141

42-
- Rust does not automatically create references for you - the `&` is always
43-
required.
42+
- Explicit referencing with `&` is usually required. However, Rust performs
43+
automatic referencing and dereferencing when invoking methods.
4444

4545
- Rust will auto-dereference in some cases, in particular when invoking methods
4646
(try `r.is_ascii()`). There is no need for an `->` operator like in C++.

0 commit comments

Comments
 (0)