From eb8a5418bdf91a64dd8fdfd2eac9131626bdae7b Mon Sep 17 00:00:00 2001 From: Gergely Risko Date: Mon, 12 Feb 2024 15:47:44 +0100 Subject: [PATCH] Use existing function as an example for automatic dereferncing (#1799) --- src/references/shared.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/references/shared.md b/src/references/shared.md index b5c19800..b73c9602 100644 --- a/src/references/shared.md +++ b/src/references/shared.md @@ -52,7 +52,7 @@ fn x_axis(x: i32) -> &(i32, i32) { required. - Rust will auto-dereference in some cases, in particular when invoking methods - (try `r.count_ones()`). There is no need for an `->` operator like in C++. + (try `r.is_ascii()`). There is no need for an `->` operator like in C++. - In this example, `r` is mutable so that it can be reassigned (`r = &b`). Note that this re-binds `r`, so that it refers to something else. This is different