mirror of
https://github.com/rust-lang/book.git
synced 2026-09-15 04:20:07 -04:00
@@ -6,10 +6,10 @@ closures: function pointers, diverging functions, and returning closures.
|
||||
### Function pointers
|
||||
|
||||
We’ve talked about how to pass closures to functions, but you can pass regular
|
||||
functions to functions too! Functions have the type `fn`, with a lower case ‘f’
|
||||
not to be confused with the `Fn` closure trait. `fn` is called a *function
|
||||
pointer*. The syntax for specifying that a parameter is a function pointer is
|
||||
similar to that of closures, as shown in Listing 19-34:
|
||||
functions to functions too! Functions coerce to the type `fn`, with a lower
|
||||
case ‘f’ not to be confused with the `Fn` closure trait. `fn` is called a
|
||||
*function pointer*. The syntax for specifying that a parameter is a function
|
||||
pointer is similar to that of closures, as shown in Listing 19-34:
|
||||
|
||||
<span class="filename">Filename: src/main.rs</span>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user