Skip to content

Commit

Permalink
Merge pull request #3290 from agotsis/closure-grammar
Browse files Browse the repository at this point in the history
Improve awkward phrasing around the kinds of closures
  • Loading branch information
chriskrycho authored Apr 19, 2024
2 parents 0bcde15 + 8264d69 commit f3d9661
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ch13-01-closures.md
Original file line number Diff line number Diff line change
Expand Up @@ -329,8 +329,8 @@ Using `FnOnce` in the trait bound expresses the constraint that
`unwrap_or_else` is only going to call `f` at most one time. In the body of
`unwrap_or_else`, we can see that if the `Option` is `Some`, `f` won’t be
called. If the `Option` is `None`, `f` will be called once. Because all
closures implement `FnOnce`, `unwrap_or_else` accepts the most different kinds
of closures and is as flexible as it can be.
closures implement `FnOnce`, `unwrap_or_else` accepts all three kinds of
closures and is as flexible as it can be.

> Note: Functions can implement all three of the `Fn` traits too. If what we
> want to do doesn’t require capturing a value from the environment, we can use
Expand Down

0 comments on commit f3d9661

Please sign in to comment.