File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -89,8 +89,8 @@ Vectors can `Deref` to a slice.
89
89
90
90
## Deref and method calls
91
91
92
- ` Deref ` will also kick in when calling a method. In other words, these are
93
- the same two things in Rust:
92
+ ` Deref ` will also kick in when calling a method. Consider the following
93
+ example.
94
94
95
95
``` rust
96
96
struct Foo ;
@@ -99,13 +99,13 @@ impl Foo {
99
99
fn foo (& self ) { println! (" Foo" ); }
100
100
}
101
101
102
- let f = Foo ;
102
+ let f = && Foo ;
103
103
104
104
f . foo ();
105
105
```
106
106
107
- Even though ` f ` isn’t a reference, and ` foo ` takes ` &self ` , this works.
108
- That’s because these things are the same:
107
+ Even though ` f ` is a ` &&Foo ` and ` foo ` takes ` &self ` , this works. That’s
108
+ because these things are the same:
109
109
110
110
``` rust,ignore
111
111
f.foo();
You can’t perform that action at this time.
0 commit comments