File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -109,11 +109,12 @@ constants can be defined with `const`:
109
109
110
110
## Types
111
111
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.
117
118
118
119
Every argument to a function must have its type declared (for example,
119
120
` x: int ` ). Inside the function, type inference will be able to
You can’t perform that action at this time.
0 commit comments