Skip to content

Commit 2e2a49a

Browse files
authored
Merge pull request #113 from qutesy/master
Update async lifetime in README.md
2 parents 89923af + d8126ee commit 2e2a49a

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)