This commit is contained in:
Michael Goulet 2024-07-16 18:59:59 -04:00
parent 3681ffd3e9
commit f8c6e9f524
1 changed files with 1 additions and 1 deletions

View File

@ -141,7 +141,7 @@ let hr = async |x: &str| { do_something(x).await };
// They can capture values by move:
let s = String::from("hello, world");
let c = async || do_something(&s).await };
let c = async move || do_something(&s).await };
```
When called, they return an anonymous future type corresponding to the (not-yet-executed) body of the closure. These can be awaited like any other future.