Skip to content

Commit d8126ee

Browse files
authored
Update async lifetime in README.md
Update the lifetimes in the example to be `'async_trait`, rather than `'async`. This brings the example into sync with `transform_sig()`.
1 parent 89923af commit d8126ee

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -103,18 +103,18 @@ can't be that badly broken.
103103
## Explanation
104104

105105
Async fns get transformed into methods that return `Pin<Box<dyn Future + Send +
106-
'async>>` and delegate to a private async freestanding function.
106+
'async_trait>>` and delegate to a private async freestanding function.
107107

108108
For example the `impl Advertisement for AutoplayingVideo` above would be
109109
expanded as:
110110

111111
```rust
112112
impl Advertisement for AutoplayingVideo {
113-
fn run<'async>(
114-
&'async self,
115-
) -> Pin<Box<dyn std::future::Future<Output = ()> + Send + 'async>>
113+
fn run<'async_trait>(
114+
&'async_trait self,
115+
) -> Pin<Box<dyn std::future::Future<Output = ()> + Send + 'async_trait>>
116116
where
117-
Self: Sync + 'async,
117+
Self: Sync + 'async_trait,
118118
{
119119
async fn run(_self: &AutoplayingVideo) {
120120
/* the original method body */

0 commit comments

Comments
 (0)