Skip to content

Commit 3823b00

Browse files
committed
---
yaml --- r: 13086 b: refs/heads/master c: 3891b5a h: refs/heads/master v: v3
1 parent c91dde5 commit 3823b00

File tree

2 files changed

+16
-15
lines changed

2 files changed

+16
-15
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 5d1c29912d7205e81726fb19571e8b706847317d
2+
refs/heads/master: 3891b5a5690b8149c60916bd92cf052d3207cdaa
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
55
refs/heads/try: 2898dcc5d97da9427ac367542382b6239d9c0bbf

trunk/doc/tutorial.md

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ characters. This is a bug that will eventually be fixed.
274274

275275
The double-colon (`::`) is used as a module separator, so
276276
`io::println` means 'the thing named `println` in the module
277-
named `io`.
277+
named `io`'.
278278

279279
Rust will normally emit warnings about unused variables. These can be
280280
suppressed by using a variable name that starts with an underscore.
@@ -1114,9 +1114,9 @@ enum direction {
11141114
This will define `north`, `east`, `south`, and `west` as constants,
11151115
all of which have type `direction`.
11161116

1117-
When the enum is C like, that is none of the variants have parameters,
1118-
it is possible to explicitly set the discriminator values to an integer
1119-
value:
1117+
When an enum is C-like, that is, when none of the variants have
1118+
parameters, it is possible to explicitly set the discriminator values
1119+
to an integer value:
11201120

11211121
~~~~
11221122
enum color {
@@ -1372,7 +1372,7 @@ destructors. Resources might go away in the future.
13721372
Rust datatypes are not trivial to copy (the way, for example,
13731373
JavaScript values can be copied by simply taking one or two machine
13741374
words and plunking them somewhere else). Shared boxes require
1375-
reference count updates, big records, enums, or unique pointers require
1375+
reference count updates, and big records, enums, or unique pointers require
13761376
an arbitrary amount of data to be copied (plus updating the reference
13771377
counts of shared boxes hanging off them).
13781378

@@ -1492,7 +1492,7 @@ simply pick the most efficient passing style. There is one exception,
14921492
which will be described in the section on [generics](#generics).
14931493

14941494
To explicitly set the passing-style for a parameter, you prefix the
1495-
argument name with a sigil. There are two special passing styles that
1495+
argument name with a sigil. There are three special passing styles that
14961496
are often useful. The first is by-mutable-pointer, written with a
14971497
single `&`:
14981498

@@ -1532,10 +1532,11 @@ non-copyable types.
15321532

15331533
## Generic functions
15341534

1535-
Throughout this tutorial, I've been defining functions like `for_rev`
1536-
that act only on integers. It is 2012, and we no longer expect to be
1537-
defining such functions again and again for every type they apply to.
1538-
Thus, Rust allows functions and datatypes to have type parameters.
1535+
Throughout this tutorial, we've been defining functions like `for_rev`
1536+
that act only on single data types. It is 2012, and we no longer
1537+
expect to be defining such functions again and again for every type
1538+
they apply to. Thus, Rust allows functions and datatypes to have type
1539+
parameters.
15391540

15401541
~~~~
15411542
fn for_rev<T>(v: [T], act: fn(T)) {
@@ -1877,7 +1878,7 @@ just fine, but it does not have access to `enc::super_secret_number`.
18771878

18781879
## Namespaces
18791880

1880-
Rust uses three different namespaces. One for modules, one for types,
1881+
Rust uses three different namespaces: one for modules, one for types,
18811882
and one for values. This means that this code is valid:
18821883

18831884
~~~~
@@ -1901,10 +1902,10 @@ though `str` is a built-in type name.
19011902
The resolution process in Rust simply goes up the chain of contexts,
19021903
looking for the name in each context. Nested functions and modules
19031904
create new contexts inside their parent function or module. A file
1904-
that's part of a bigger crate will have that crate's context as parent
1905-
context.
1905+
that's part of a bigger crate will have that crate's context as its
1906+
parent context.
19061907

1907-
Identifiers can shadow each others. In this program, `x` is of type
1908+
Identifiers can shadow each other. In this program, `x` is of type
19081909
`int`:
19091910

19101911
~~~~

0 commit comments

Comments
 (0)