Rollup merge of #28617 - tshepang:optional, r=steveklabnik
This commit is contained in:
@@ -900,9 +900,10 @@ fn main() {}
|
|||||||
|
|
||||||
### Functions
|
### Functions
|
||||||
|
|
||||||
A _function item_ defines a sequence of [statements](#statements) and an
|
A _function item_ defines a sequence of [statements](#statements) and a
|
||||||
optional final [expression](#expressions), along with a name and a set of
|
final [expression](#expressions), along with a name and a set of
|
||||||
parameters. Functions are declared with the keyword `fn`. Functions declare a
|
parameters. Other than a name, all these are optional.
|
||||||
|
Functions are declared with the keyword `fn`. Functions may declare a
|
||||||
set of *input* [*variables*](#variables) as parameters, through which the caller
|
set of *input* [*variables*](#variables) as parameters, through which the caller
|
||||||
passes arguments into the function, and the *output* [*type*](#types)
|
passes arguments into the function, and the *output* [*type*](#types)
|
||||||
of the value the function will return to its caller on completion.
|
of the value the function will return to its caller on completion.
|
||||||
|
|||||||
Reference in New Issue
Block a user