Skip to content

Commit c202f4b

Browse files
committed
---
yaml --- r: 155631 b: refs/heads/try2 c: e2357cf h: refs/heads/master i: 155629: 3e7d25c 155627: b514d88 155623: 4403591 155615: 6dbc2e9 v: v3
1 parent c04d1a6 commit c202f4b

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
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: ee1cbb9c71bfab8500dfabedb35ba63dd1e5b7ff
8+
refs/heads/try2: e2357cf41b69c6db57bbf53c63f59376576c72ae
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/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)