@@ -38,7 +38,7 @@ fn fac(n: int) -> int {
38
38
Several differences from C stand out. Types do not come before, but
39
39
after variable names (preceded by a colon). In local variables
40
40
(introduced with ` let ` ), they are optional, and will be inferred when
41
- left off. Constructs like ` while ` and ` if ` do not require parenthesis
41
+ left off. Constructs like ` while ` and ` if ` do not require parentheses
42
42
around the condition (though they allow them). Also, there's a
43
43
tendency towards aggressive abbreviation in the keywords—` fn ` for
44
44
function, ` ret ` for return.
@@ -52,7 +52,7 @@ quite a different direction.
52
52
Throughout the tutorial, words that indicate language keywords or
53
53
identifiers defined in the example code are displayed in ` code font ` .
54
54
55
- Code snippets are indented, and also shown in a monospace font. Not
55
+ Code snippets are indented, and also shown in a monospaced font. Not
56
56
all snippets constitute whole programs. For brevity, we'll often show
57
57
fragments of programs that don't compile on their own. To try them
58
58
out, you might have to wrap them in ` fn main() { ... } ` , and make sure
@@ -176,7 +176,7 @@ detail [later on](#modules-and-crates).
176
176
177
177
## Editing Rust code
178
178
179
- There are Vim highlighting and indentation scrips in the Rust source
179
+ There are Vim highlighting and indentation scripts in the Rust source
180
180
distribution under ` src/etc/vim/ ` , and an emacs mode under
181
181
` src/etc/emacs/ ` .
182
182
@@ -260,7 +260,7 @@ fn is_four(x: int) -> bool { x == 4 }
260
260
~~~~
261
261
262
262
In short, everything that's not a declaration (` let ` for variables,
263
- ` fn ` for functions, etcetera ) is an expression.
263
+ ` fn ` for functions, et cetera ) is an expression.
264
264
265
265
If all those things are expressions, you might conclude that you have
266
266
to add a terminating semicolon after * every* statement, even ones that
@@ -285,7 +285,7 @@ The double-colon (`::`) is used as a module separator, so
285
285
` std::io::println ` means 'the thing named ` println ` in the module
286
286
named ` io ` in the module named ` std ` '.
287
287
288
- Rust will normally emit warning about unused variables. These can be
288
+ Rust will normally emit warnings about unused variables. These can be
289
289
suppressed by using a variable name that starts with an underscore.
290
290
291
291
~~~~
@@ -364,7 +364,7 @@ The basic types are written like this:
364
364
: A character is a 32-bit Unicode code point.
365
365
366
366
` str `
367
- : String type. A string contains a utf -8 encoded sequence of characters.
367
+ : String type. A string contains a UTF -8 encoded sequence of characters.
368
368
369
369
These can be combined in composite types, which will be described in
370
370
more detail later on (the ` T ` s here stand for any other type):
@@ -403,7 +403,7 @@ synonym.
403
403
## Literals
404
404
405
405
Integers can be written in decimal (` 144 ` ), hexadecimal (` 0x90 ` ), and
406
- binary (` 0b10010000 ` ) base. Without suffix, an integer literal is
406
+ binary (` 0b10010000 ` ) base. Without a suffix, an integer literal is
407
407
considered to be of type ` int ` . Add a ` u ` (` 144u ` ) to make it a ` uint `
408
408
instead. Literals of the fixed-size integer types can be created by
409
409
the literal with the type name (` 255u8 ` , ` 50i64 ` , etc).
@@ -413,7 +413,7 @@ happens. If you are adding one to a variable of type `uint`, you must
413
413
type ` v += 1u ` —saying ` += 1 ` will give you a type error.
414
414
415
415
Floating point numbers are written ` 0.0 ` , ` 1e6 ` , or ` 2.1e-4 ` . Without
416
- suffix, the literal is assumed to be of type ` float ` . Suffixes ` f32 `
416
+ a suffix, the literal is assumed to be of type ` float ` . Suffixes ` f32 `
417
417
and ` f64 ` can be used to create literals of a specific type. The
418
418
suffix ` f ` can be used to write ` float ` literals without a dot or
419
419
exponent: ` 3f ` .
@@ -423,11 +423,11 @@ The nil literal is written just like the type: `()`. The keywords
423
423
424
424
Character literals are written between single quotes, as in ` 'x' ` . You
425
425
may put non-ascii characters between single quotes (your source files
426
- should be encoded as utf -8). Rust understands a number of
426
+ should be encoded as UTF -8). Rust understands a number of
427
427
character escapes, using the backslash character:
428
428
429
429
` \n `
430
- : A newline (unicode character 32).
430
+ : A newline (Unicode character 32).
431
431
432
432
` \r `
433
433
: A carriage return (13).
@@ -912,7 +912,7 @@ compiler can look at the argument type to find out what the parameter
912
912
types are.
913
913
914
914
As a further simplification, if the final parameter to a function is a
915
- closure, the closure need not be placed within parenthesis . You could,
915
+ closure, the closure need not be placed within parentheses . You could,
916
916
for example, write...
917
917
918
918
~~~~
0 commit comments