]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/src/docs/async_yields_async.txt
Rollup merge of #101389 - lukaslueg:rcgetmutdocs, r=m-ou-se
[rust.git] / src / tools / clippy / src / docs / async_yields_async.txt
1 ### What it does
2 Checks for async blocks that yield values of types
3 that can themselves be awaited.
4
5 ### Why is this bad?
6 An await is likely missing.
7
8 ### Example
9 ```
10 async fn foo() {}
11
12 fn bar() {
13   let x = async {
14     foo()
15   };
16 }
17 ```
18
19 Use instead:
20 ```
21 async fn foo() {}
22
23 fn bar() {
24   let x = async {
25     foo().await
26   };
27 }
28 ```