]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/src/docs/manual_async_fn.txt
Auto merge of #98559 - jackh726:remove-reempty, r=oli-obk
[rust.git] / src / tools / clippy / 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 ```