@@ -689,7 +689,7 @@ fn main() {
689
689
```
690
690
691
691
This is the simplest possible function declaration. As we mentioned before,
692
- ` fn ` says 'this is a function,' followed by the name, some parenthesis because
692
+ ` fn ` says 'this is a function,' followed by the name, some parentheses because
693
693
this function takes no arguments, and then some curly braces to indicate the
694
694
body. Here's a function named ` foo ` :
695
695
@@ -890,7 +890,7 @@ Tuples are an ordered list of a fixed size. Like this:
890
890
let x = (1i , " hello" );
891
891
```
892
892
893
- The parenthesis and commas form this two-length tuple. Here's the same code, but
893
+ The parentheses and commas form this two-length tuple. Here's the same code, but
894
894
with the type annotated:
895
895
896
896
``` rust
@@ -914,9 +914,9 @@ let (x, y, z) = (1i, 2i, 3i);
914
914
println! (" x is {}" , x );
915
915
```
916
916
917
- Remember before when I said the left hand side of a ` let ` statement was more
917
+ Remember before when I said the left- hand side of a ` let ` statement was more
918
918
powerful than just assigning a binding? Here we are. We can put a pattern on
919
- the left hand side of the ` let ` , and if it matches up to the right hand side,
919
+ the left- hand side of the ` let ` , and if it matches up to the right- hand side,
920
920
we can assign multiple bindings at once. In this case, ` let ` 'destructures,'
921
921
or 'breaks up,' the tuple, and assigns the bits to three bindings.
922
922
@@ -1459,9 +1459,9 @@ focus. Any time you have a data structure of variable size, things can get
1459
1459
tricky, and strings are a re-sizable data structure. That said, Rust's strings
1460
1460
also work differently than in some other systems languages, such as C.
1461
1461
1462
- Let's dig into the details. A ** string** is a sequence of unicode scalar values
1462
+ Let's dig into the details. A ** string** is a sequence of Unicode scalar values
1463
1463
encoded as a stream of UTF-8 bytes. All strings are guaranteed to be
1464
- validly- encoded UTF-8 sequences. Additionally, strings are not null-terminated
1464
+ validly encoded UTF-8 sequences. Additionally, strings are not null-terminated
1465
1465
and can contain null bytes.
1466
1466
1467
1467
Rust has two main types of strings: ` &str ` and ` String ` .
@@ -3939,7 +3939,7 @@ match x {
3939
3939
}
3940
3940
```
3941
3941
3942
- Here, the ` val ` inside the ` match ` has type ` int ` . In other words, the left hand
3942
+ Here, the ` val ` inside the ` match ` has type ` int ` . In other words, the left- hand
3943
3943
side of the pattern destructures the value. If we have ` &5i ` , then in ` &val ` , ` val `
3944
3944
would be ` 5i ` .
3945
3945
@@ -4716,7 +4716,7 @@ let x: Option<int> = Some(5i);
4716
4716
4717
4717
In the type declaration, we say ` Option<int> ` . Note how similar this looks to
4718
4718
` Option<T> ` . So, in this particular ` Option ` , ` T ` has the value of ` int ` . On
4719
- the right hand side of the binding, we do make a ` Some(T) ` , where ` T ` is ` 5i ` .
4719
+ the right- hand side of the binding, we do make a ` Some(T) ` , where ` T ` is ` 5i ` .
4720
4720
Since that's an ` int ` , the two sides match, and Rust is happy. If they didn't
4721
4721
match, we'd get an error:
4722
4722
0 commit comments