Skip to content

Commit

Permalink
Remove misleading statement about closure types. Fixes #168
Browse files Browse the repository at this point in the history
  • Loading branch information
willcrichton committed Mar 21, 2024
1 parent 0973470 commit 95ba733
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/ch19-05-advanced-functions-and-closures.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,7 @@ Closures are represented by traits, which means you can’t return closures
directly. In most cases where you might want to return a trait, you can instead
use the concrete type that implements the trait as the return type of the
function. However, you can’t do that with closures because they don’t have a
concrete type that is returnable; you’re not allowed to use the function
pointer `fn` as a return type, for example.
concrete type that is returnable.

The following code tries to return a closure directly, but it won’t compile:

Expand Down

0 comments on commit 95ba733

Please sign in to comment.