mirror of
https://github.com/google/comprehensive-rust.git
synced 2025-03-19 22:19:29 +02:00
Use existing function as an example for automatic dereferncing (#1799)
This commit is contained in:
parent
2e2d47c709
commit
eb8a5418bd
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user