Skip to content

Commit 62137b6

Browse files
committed
rollup merge of rust-lang#19336: apasel422/guide
- `s/(left|right) hand/\1-hand/` - `s/parenthesis/parentheses/` - `s/unicode/Unicode/` - `s/validly-encoded/validly encoded/`
2 parents 8f94ea0 + b7520f5 commit 62137b6

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/doc/guide.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -689,7 +689,7 @@ fn main() {
689689
```
690690

691691
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
693693
this function takes no arguments, and then some curly braces to indicate the
694694
body. Here's a function named `foo`:
695695

@@ -890,7 +890,7 @@ Tuples are an ordered list of a fixed size. Like this:
890890
let x = (1i, "hello");
891891
```
892892

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
894894
with the type annotated:
895895

896896
```rust
@@ -914,9 +914,9 @@ let (x, y, z) = (1i, 2i, 3i);
914914
println!("x is {}", x);
915915
```
916916

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
918918
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,
920920
we can assign multiple bindings at once. In this case, `let` 'destructures,'
921921
or 'breaks up,' the tuple, and assigns the bits to three bindings.
922922

@@ -1459,9 +1459,9 @@ focus. Any time you have a data structure of variable size, things can get
14591459
tricky, and strings are a re-sizable data structure. That said, Rust's strings
14601460
also work differently than in some other systems languages, such as C.
14611461

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
14631463
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
14651465
and can contain null bytes.
14661466

14671467
Rust has two main types of strings: `&str` and `String`.
@@ -3939,7 +3939,7 @@ match x {
39393939
}
39403940
```
39413941

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
39433943
side of the pattern destructures the value. If we have `&5i`, then in `&val`, `val`
39443944
would be `5i`.
39453945

@@ -4716,7 +4716,7 @@ let x: Option<int> = Some(5i);
47164716

47174717
In the type declaration, we say `Option<int>`. Note how similar this looks to
47184718
`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`.
47204720
Since that's an `int`, the two sides match, and Rust is happy. If they didn't
47214721
match, we'd get an error:
47224722

0 commit comments

Comments
 (0)