Skip to content

Commit

Permalink
Merge pull request #51 from rust-lang/update-rfc-000-explainer
Browse files Browse the repository at this point in the history
make connection between traits and methods more explicit
  • Loading branch information
yoshuawuyts committed Feb 22, 2024
2 parents e618b73 + 75af7dc commit fc99ef7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions explainer/effect-generic-trait-declarations.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ the `async` effect. If they want the `async` version they can include the

```rust
/// The base implementation
impl Into<Loaf> for Cat {
fn into(self) -> Loaf {
impl Into<Loaf> for Cat { // The trait is not marked async…
fn into(self) -> Loaf { // and thus neither is the method.
self.nap()
}
}

/// The async implementation
impl async Into<AsyncLoaf> for AsyncCat {
async fn into(self) -> AsyncLoaf {
impl async Into<AsyncLoaf> for AsyncCat { // The trait is marked async…
async fn into(self) -> AsyncLoaf { // and thus so is the method.
self.async_nap().await
}
}
Expand Down

0 comments on commit fc99ef7

Please sign in to comment.