Skip to content

Commit 676ccd8

Browse files
committed
migration: autoderef workaround still works with just *self.
1 parent f8c79fe commit 676ccd8

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

docs/migrating-from-0.2-to-1.0.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ have mutable state or access exclusive resources.
340340
for implementations.
341341

342342
For ease of use, you might want to provide inherent methods that take `&self` if the hardware permits it. In this case,
343-
you might need to do `&*self` to call them from the trait methods. Otherwise Rust will resolve the
343+
you might need to do `*self` to call them from the trait methods. Otherwise Rust will resolve the
344344
method call to the trait method, causing infinite recursion.
345345

346346
```rust
@@ -358,12 +358,12 @@ impl HalPin {
358358

359359
impl InputPin for HalPin {
360360
fn is_high(&mut self) -> Result<bool, Self::Error> {
361-
// Needs `&*self` so that the inherent `is_high` is picked.
362-
Ok((&*self).is_high())
361+
// Needs `*self` so that the inherent `is_high` is picked.
362+
Ok((*self).is_high())
363363
}
364364

365365
fn is_low(&mut self) -> Result<bool, Self::Error> {
366-
Ok((&*self).is_low())
366+
Ok((*self).is_low())
367367
}
368368
}
369369
```

0 commit comments

Comments
 (0)