Skip to content

Commit 5bb8817

Browse files
committed
---
yaml --- r: 137087 b: refs/heads/release-prep c: e2357cf h: refs/heads/master i: 137085: 0f1f6da 137083: 9ce4a8d 137079: 2c9bfcf 137071: 4a871de 137055: c4bb179 137023: ce63276 136959: 27850a0 v: v3
1 parent 0235157 commit 5bb8817

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@ refs/tags/0.9: 36870b185fc5f5486636d4515f0e22677493f225
2929
refs/tags/0.10: ac33f2b15782272ae348dbd7b14b8257b2148b5a
3030
refs/heads/libuv-update-temp-branch: 6ed22c618766f1f2a2e108eef8ce3f51be0f70b7
3131
refs/tags/0.11.0: e1247cb1d0d681be034adb4b558b5a0c0d5720f9
32-
refs/heads/release-prep: ee1cbb9c71bfab8500dfabedb35ba63dd1e5b7ff
32+
refs/heads/release-prep: e2357cf41b69c6db57bbf53c63f59376576c72ae

branches/release-prep/src/doc/guide.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -659,14 +659,12 @@ error: mismatched types: expected `int` but found `()` (expected int but found (
659659
```
660660

661661
We expected an integer, but we got `()`. `()` is pronounced 'unit', and is a
662-
special type in Rust's type system. `()` is different than `null` in other
663-
languages, because `()` is distinct from other types. For example, in C, `null`
664-
is a valid value for a variable of type `int`. In Rust, `()` is _not_ a valid
665-
value for a variable of type `int`. It's only a valid value for variables of
666-
the type `()`, which aren't very useful. Remember how we said statements don't
667-
return a value? Well, that's the purpose of unit in this case. The semicolon
668-
turns any expression into a statement by throwing away its value and returning
669-
unit instead.
662+
special type in Rust's type system. In Rust, `()` is _not_ a valid value for a
663+
variable of type `int`. It's only a valid value for variables of the type `()`,
664+
which aren't very useful. Remember how we said statements don't return a value?
665+
Well, that's the purpose of unit in this case. The semicolon turns any
666+
expression into a statement by throwing away its value and returning unit
667+
instead.
670668

671669
There's one more time in which you won't see a semicolon at the end of a line
672670
of Rust code. For that, we'll need our next concept: functions.

0 commit comments

Comments
 (0)