Skip to content

Commit fb57f21

Browse files
Jaxelrmarcoieni
andauthored
Fix syntax error on code snippet (#246)
* Fix syntax error on code snippet * Added comma to struct definition on code snippet * cargo fmt, remove ignore flag Co-authored-by: Marco Ieni <[email protected]>
1 parent 881f51f commit fb57f21

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

anti_patterns/deref.md

+3-4
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public static void main(String[] args) {
2525

2626
We can use the deref polymorphism anti-pattern to do so:
2727

28-
```rust,ignore
28+
```rust
2929
use std::ops::Deref;
3030

3131
struct Foo {}
@@ -34,11 +34,10 @@ impl Foo {
3434
fn m(&self) {
3535
//..
3636
}
37-
3837
}
3938

4039
struct Bar {
41-
f: Foo
40+
f: Foo,
4241
}
4342

4443
impl Deref for Bar {
@@ -49,7 +48,7 @@ impl Deref for Bar {
4948
}
5049

5150
fn main() {
52-
let b = Bar { Foo {} };
51+
let b = Bar { f: Foo {} };
5352
b.m();
5453
}
5554
```

0 commit comments

Comments
 (0)