]> git.lizzy.rs Git - rust.git/blob - src/docs/manual_async_fn.txt
Auto merge of #9425 - kraktus:patch-1, r=xFrednet
[rust.git] / src / docs / manual_async_fn.txt
1 ### What it does
2 It checks for manual implementations of `async` functions.
3
4 ### Why is this bad?
5 It's more idiomatic to use the dedicated syntax.
6
7 ### Example
8 ```
9 use std::future::Future;
10
11 fn foo() -> impl Future<Output = i32> { async { 42 } }
12 ```
13 Use instead:
14 ```
15 async fn foo() -> i32 { 42 }
16 ```