@@ -683,7 +683,7 @@ fn main() {
683
683
```
684
684
685
685
This is the simplest possible function declaration. As we mentioned before,
686
- ` fn ` says 'this is a function,' followed by the name, some parenthesis because
686
+ ` fn ` says 'this is a function,' followed by the name, some parentheses because
687
687
this function takes no arguments, and then some curly braces to indicate the
688
688
body. Here's a function named ` foo ` :
689
689
@@ -884,7 +884,7 @@ Tuples are an ordered list of a fixed size. Like this:
884
884
let x = (1i , " hello" );
885
885
```
886
886
887
- The parenthesis and commas form this two-length tuple. Here's the same code, but
887
+ The parentheses and commas form this two-length tuple. Here's the same code, but
888
888
with the type annotated:
889
889
890
890
``` rust
@@ -908,9 +908,9 @@ let (x, y, z) = (1i, 2i, 3i);
908
908
println! (" x is {}" , x );
909
909
```
910
910
911
- Remember before when I said the left hand side of a ` let ` statement was more
911
+ Remember before when I said the left- hand side of a ` let ` statement was more
912
912
powerful than just assigning a binding? Here we are. We can put a pattern on
913
- the left hand side of the ` let ` , and if it matches up to the right hand side,
913
+ the left- hand side of the ` let ` , and if it matches up to the right- hand side,
914
914
we can assign multiple bindings at once. In this case, ` let ` 'destructures,'
915
915
or 'breaks up,' the tuple, and assigns the bits to three bindings.
916
916
@@ -1453,9 +1453,9 @@ focus. Any time you have a data structure of variable size, things can get
1453
1453
tricky, and strings are a re-sizable data structure. That said, Rust's strings
1454
1454
also work differently than in some other systems languages, such as C.
1455
1455
1456
- Let's dig into the details. A ** string** is a sequence of unicode scalar values
1456
+ Let's dig into the details. A ** string** is a sequence of Unicode scalar values
1457
1457
encoded as a stream of UTF-8 bytes. All strings are guaranteed to be
1458
- validly- encoded UTF-8 sequences. Additionally, strings are not null-terminated
1458
+ validly encoded UTF-8 sequences. Additionally, strings are not null-terminated
1459
1459
and can contain null bytes.
1460
1460
1461
1461
Rust has two main types of strings: ` &str ` and ` String ` .
@@ -3933,7 +3933,7 @@ match x {
3933
3933
}
3934
3934
```
3935
3935
3936
- Here, the ` val ` inside the ` match ` has type ` int ` . In other words, the left hand
3936
+ Here, the ` val ` inside the ` match ` has type ` int ` . In other words, the left- hand
3937
3937
side of the pattern destructures the value. If we have ` &5i ` , then in ` &val ` , ` val `
3938
3938
would be ` 5i ` .
3939
3939
@@ -4681,7 +4681,7 @@ let x: Option<int> = Some(5i);
4681
4681
4682
4682
In the type declaration, we say ` Option<int> ` . Note how similar this looks to
4683
4683
` Option<T> ` . So, in this particular ` Option ` , ` T ` has the value of ` int ` . On
4684
- the right hand side of the binding, we do make a ` Some(T) ` , where ` T ` is ` 5i ` .
4684
+ the right- hand side of the binding, we do make a ` Some(T) ` , where ` T ` is ` 5i ` .
4685
4685
Since that's an ` int ` , the two sides match, and Rust is happy. If they didn't
4686
4686
match, we'd get an error:
4687
4687
0 commit comments