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 <11428655+MarcoIeni@users.noreply.github.com>
pull/109/merge
Jaxel Rojas 3 years ago committed by GitHub
parent 881f51fef1
commit fb57f21ec1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -25,7 +25,7 @@ public static void main(String[] args) {
We can use the deref polymorphism anti-pattern to do so:
```rust,ignore
```rust
use std::ops::Deref;
struct Foo {}
@ -34,11 +34,10 @@ impl Foo {
fn m(&self) {
//..
}
}
struct Bar {
f: Foo
f: Foo,
}
impl Deref for Bar {
@ -49,7 +48,7 @@ impl Deref for Bar {
}
fn main() {
let b = Bar { Foo {} };
let b = Bar { f: Foo {} };
b.m();
}
```

Loading…
Cancel
Save