Merge pull request #3341 from rust-lang/spastorino-patch-2

async fns desugared version is async move
This commit is contained in:
Niko Matsakis 2022-11-01 10:54:03 -04:00 committed by GitHub
commit 01d542fa57
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -49,7 +49,7 @@ Note that if a function in a trait is written as an `async fn`, it must also be
```rust ```rust
impl Service for MyService { impl Service for MyService {
fn request(&self, key: i32) -> impl Future<Output = Response> { fn request(&self, key: i32) -> impl Future<Output = Response> {
async { async move {
... ...
} }
} }
@ -71,7 +71,7 @@ impl Service for MyService {
where where
Self: 'a; Self: 'a;
fn request<'a>(&'a self, key: i32) -> RequestFut<'a> { fn request<'a>(&'a self, key: i32) -> RequestFut<'a> {
async { ... } async move { ... }
} }
} }
``` ```