Skip to content

Commit 8f7657b

Browse files
committed
2022-10-18-new-release: Move from imp.instance() to imp.obj()
It's doing the same thing and is shorter.
1 parent 2a0a20e commit 8f7657b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

_posts/2022-10-18-new-release.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,13 +148,13 @@ pub trait ObjectImpl {
148148
}
149149
```
150150

151-
In most contexts the object itself was not actually needed, so this also simplifies the code. For the cases when the object is needed, it can be retrieved via the `instance()` method on the implementation struct
151+
In most contexts the object itself was not actually needed, so this also simplifies the code. For the cases when the object is needed, it can be retrieved via the `obj()` method on the implementation struct
152152

153153
```rust
154154
impl ObjectImpl for MyObject {
155155
fn constructed(&self) {
156-
let instance = self.instance();
157-
instance.do_something();
156+
let obj = self.obj();
157+
obj.do_something();
158158
}
159159
}
160160
```

0 commit comments

Comments
 (0)