diff options
| author | Marijn Haverbeke <marijnh@gmail.com> | 2011-11-02 19:03:33 +0100 |
|---|---|---|
| committer | Marijn Haverbeke <marijnh@gmail.com> | 2011-11-02 19:03:49 +0100 |
| commit | eed782c7783f3f7dd57323e238e674bf4cfe77a9 (patch) | |
| tree | 55d68e06c8c14463ad0590134e93ad6ba8503210 /doc/tutorial | |
| parent | eef9a0bd3941a6d2d25db4635295198903575e6b (diff) | |
| download | rust-eed782c7783f3f7dd57323e238e674bf4cfe77a9.tar.gz rust-eed782c7783f3f7dd57323e238e674bf4cfe77a9.zip | |
Fix confusing sentence in tutorial.
Diffstat (limited to 'doc/tutorial')
| -rw-r--r-- | doc/tutorial/syntax.md | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/doc/tutorial/syntax.md b/doc/tutorial/syntax.md index acef5163a59..75bcb2df4cd 100644 --- a/doc/tutorial/syntax.md +++ b/doc/tutorial/syntax.md @@ -109,11 +109,12 @@ constants can be defined with `const`: ## Types -The `-> bool` in the last example is the way a function's return type -is written. For functions that do not return a meaningful value (these -conceptually return nil in Rust), you can optionally say `-> ()` (`()` -is how nil is written), but usually the return annotation is simply -left off, as in the `fn main() { ... }` examples we've seen earlier. +The `-> bool` in the `is_four` example is the way a function's return +type is written. For functions that do not return a meaningful value +(these conceptually return nil in Rust), you can optionally say `-> +()` (`()` is how nil is written), but usually the return annotation is +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, `x: int`). Inside the function, type inference will be able to |
