Skip to content

Commit

Permalink
auto merge of #5651 : luqmana/rust/incoming, r=thestinger
Browse files Browse the repository at this point in the history
Change fn() -> &fn().
  • Loading branch information
bors committed Apr 1, 2013
2 parents 686f448 + d617030 commit be79258
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions doc/tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -1539,9 +1539,9 @@ for spawning [tasks][tasks].

Rust closures have a convenient subtyping property: you can pass any kind of
closure (as long as the arguments and return types match) to functions
that expect a `fn()`. Thus, when writing a higher-order function that
that expect a `&fn()`. Thus, when writing a higher-order function that
only calls its function argument, and does nothing else with it, you
should almost always declare the type of that argument as `fn()`. That way,
should almost always declare the type of that argument as `&fn()`. That way,
callers may pass any kind of closure.

~~~~
Expand Down

0 comments on commit be79258

Please sign in to comment.