Skip to content

Commit

Permalink
Merge pull request #3752 from po1onius/oversight-fix
Browse files Browse the repository at this point in the history
Fix syntax error caused by missing curly braces in example code
  • Loading branch information
Noratrieb authored Dec 30, 2024
2 parents 34c5c30 + 8082b81 commit aa49c76
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion text/3668-async-closures.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,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 move || 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.
Expand Down

0 comments on commit aa49c76

Please sign in to comment.