Fix confusing sentence in tutorial.
This commit is contained in:
parent
eef9a0bd39
commit
eed782c778
|
@ -109,11 +109,12 @@ constants can be defined with `const`:
|
||||||
|
|
||||||
## Types
|
## Types
|
||||||
|
|
||||||
The `-> bool` in the last example is the way a function's return type
|
The `-> bool` in the `is_four` example is the way a function's return
|
||||||
is written. For functions that do not return a meaningful value (these
|
type is written. For functions that do not return a meaningful value
|
||||||
conceptually return nil in Rust), you can optionally say `-> ()` (`()`
|
(these conceptually return nil in Rust), you can optionally say `->
|
||||||
is how nil is written), but usually the return annotation is simply
|
()` (`()` is how nil is written), but usually the return annotation is
|
||||||
left off, as in the `fn main() { ... }` examples we've seen earlier.
|
simply left off, as in the `fn main() { ... }` examples we've seen
|
||||||
|
earlier.
|
||||||
|
|
||||||
Every argument to a function must have its type declared (for example,
|
Every argument to a function must have its type declared (for example,
|
||||||
`x: int`). Inside the function, type inference will be able to
|
`x: int`). Inside the function, type inference will be able to
|
||||||
|
|
Loading…
Reference in New Issue