Skip to content

Commit 8f2cf33

Browse files
committed
Slight rewording of async closure expr
Minor rewording with an eye towards marking these with individual rules.
1 parent 721b5cb commit 8f2cf33

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/expressions/closure-expr.md

+7-4
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,13 @@ The closure type implements [`Send`] and [`Sync`] if the type of every captured
3838

3939
## Async closures
4040

41-
When a closure is marked with the `async` keyword, it is allowed to `await` futures in its body.
42-
Calling the closure evaluates to a future that corresponds to the computation of the body of the closure.
43-
This closure implements `AsyncFn`, `AsyncFnMut`, and `AsyncFnOnce` depending on the use of the captured variables in its body.
44-
It may also implement `Fn`, `FnMut`, and `FnOnce` if the future it returns does not borrow any captured variables from the closure itself.
41+
Closures marked with the `async` keyword indicate that they are asynchronous in an analogous way to an [async function][items.fn.async].
42+
43+
Calling the async closure does not perform any work, but instead evaluates to a value that implements [`Future`] that corresponds to the computation of the body of the closure.
44+
45+
Async closures implement [`AsyncFn`], [`AsyncFnMut`], and [`AsyncFnOnce`] depending on the use of the captured variables in its body.
46+
47+
Async closures may also implement [`Fn`], [`FnMut`], and [`FnOnce`] if the future it returns does not borrow any captured variables from the closure itself.
4548

4649
> **Edition differences**: Async closures are only available beginning with Rust 2018.
4750

0 commit comments

Comments
 (0)