Skip to content

Commit eed782c

Browse files
committed
Fix confusing sentence in tutorial.
1 parent eef9a0b commit eed782c

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

doc/tutorial/syntax.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -109,11 +109,12 @@ constants can be defined with `const`:
109109

110110
## Types
111111

112-
The `-> bool` in the last example is the way a function's return type
113-
is written. For functions that do not return a meaningful value (these
114-
conceptually return nil in Rust), you can optionally say `-> ()` (`()`
115-
is how nil is written), but usually the return annotation is simply
116-
left off, as in the `fn main() { ... }` examples we've seen earlier.
112+
The `-> bool` in the `is_four` example is the way a function's return
113+
type is written. For functions that do not return a meaningful value
114+
(these conceptually return nil in Rust), you can optionally say `->
115+
()` (`()` is how nil is written), but usually the return annotation is
116+
simply left off, as in the `fn main() { ... }` examples we've seen
117+
earlier.
117118

118119
Every argument to a function must have its type declared (for example,
119120
`x: int`). Inside the function, type inference will be able to

0 commit comments

Comments
 (0)