@@ -358,7 +358,7 @@ This may sound intricate, but it is super-useful and will grow on you.
358
358
359
359
## Types
360
360
361
- The basic types include the usual boolean, integral, and floating point types.
361
+ The basic types include the usual boolean, integral, and floating- point types.
362
362
363
363
------------------------- -----------------------------------------------
364
364
` () ` Nil, the type that has only a single value
@@ -367,8 +367,8 @@ The basic types include the usual boolean, integral, and floating point types.
367
367
` i8 ` , ` i16 ` , ` i32 ` , ` i64 ` Signed integers with a specific size (in bits)
368
368
` u8 ` , ` u16 ` , ` u32 ` , ` u64 ` Unsigned integers with a specific size
369
369
` float ` The largest floating-point type efficiently supported on the target machine
370
- ` f32 ` , ` f64 ` Floating-point types with a specific size.
371
- ` char ` A Unicode character (32 bits).
370
+ ` f32 ` , ` f64 ` Floating-point types with a specific size
371
+ ` char ` A Unicode character (32 bits)
372
372
------------------------- -----------------------------------------------
373
373
374
374
These can be combined in composite types, which will be described in
@@ -378,7 +378,7 @@ while N should be a literal number):
378
378
------------------------- -----------------------------------------------
379
379
` [T * N] ` Vector (like an array in other languages) with N elements
380
380
` [mut T * N] ` Mutable vector with N elements
381
- ` (T1, T2) ` Tuple type. Any arity above 1 is supported
381
+ ` (T1, T2) ` Tuple type; any arity above 1 is supported
382
382
` &T ` , ` ~T ` , ` @T ` [ Pointer types] ( #boxes-and-pointers )
383
383
------------------------- -----------------------------------------------
384
384
@@ -863,7 +863,7 @@ the return type follows the arrow.
863
863
864
864
~~~~
865
865
fn line(a: int, b: int, x: int) -> int {
866
- return a* x + b;
866
+ return a * x + b;
867
867
}
868
868
~~~~
869
869
@@ -874,7 +874,7 @@ expression.
874
874
875
875
~~~~
876
876
fn line(a: int, b: int, x: int) -> int {
877
- a* x + b
877
+ a * x + b
878
878
}
879
879
~~~~
880
880
@@ -891,11 +891,11 @@ fn do_nothing_the_easy_way() { }
891
891
Ending the function with a semicolon like so is equivalent to returning ` () ` .
892
892
893
893
~~~~
894
- fn line(a: int, b: int, x: int) -> int { a* x + b }
895
- fn oops(a: int, b: int, x: int) -> () { a* x + b; }
894
+ fn line(a: int, b: int, x: int) -> int { a * x + b }
895
+ fn oops(a: int, b: int, x: int) -> () { a * x + b; }
896
896
897
- assert 8 == line(5,3, 1);
898
- assert () == oops(5,3, 1);
897
+ assert 8 == line(5, 3, 1);
898
+ assert () == oops(5, 3, 1);
899
899
~~~~
900
900
901
901
Methods are like functions, except that they are defined for a specific
@@ -1319,7 +1319,7 @@ Strings are implemented with vectors of `[u8]`, though they have a distinct
1319
1319
type. They support most of the same allocation options as
1320
1320
vectors, though the string literal without a storage sigil, e.g.
1321
1321
`"foo"` is treated differently than a comparable vector (`[foo]`).
1322
- Wheras plain vectors are stack-allocated fixed length vectors,
1322
+ Whereas plain vectors are stack-allocated fixed- length vectors,
1323
1323
plain strings are region pointers to read-only memory.
1324
1324
1325
1325
~~~
0 commit comments