We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 881f51f commit fb57f21Copy full SHA for fb57f21
anti_patterns/deref.md
@@ -25,7 +25,7 @@ public static void main(String[] args) {
25
26
We can use the deref polymorphism anti-pattern to do so:
27
28
-```rust,ignore
+```rust
29
use std::ops::Deref;
30
31
struct Foo {}
@@ -34,11 +34,10 @@ impl Foo {
34
fn m(&self) {
35
//..
36
}
37
-
38
39
40
struct Bar {
41
- f: Foo
+ f: Foo,
42
43
44
impl Deref for Bar {
@@ -49,7 +48,7 @@ impl Deref for Bar {
49
48
50
51
fn main() {
52
- let b = Bar { Foo {} };
+ let b = Bar { f: Foo {} };
53
b.m();
54
55
```
0 commit comments