summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/src/docs/async_yields_async.txt
blob: a40de6d2e473642505f16e46054228bf658eb885 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
### What it does
Checks for async blocks that yield values of types
that can themselves be awaited.

### Why is this bad?
An await is likely missing.

### Example
```
async fn foo() {}

fn bar() {
  let x = async {
    foo()
  };
}
```

Use instead:
```
async fn foo() {}

fn bar() {
  let x = async {
    foo().await
  };
}
```