diff options
Diffstat (limited to '')
-rw-r--r-- | src/tools/clippy/src/docs/async_yields_async.txt | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/tools/clippy/src/docs/async_yields_async.txt b/src/tools/clippy/src/docs/async_yields_async.txt new file mode 100644 index 000000000..a40de6d2e --- /dev/null +++ b/src/tools/clippy/src/docs/async_yields_async.txt @@ -0,0 +1,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 + }; +} +```
\ No newline at end of file |