Skip to content

Commit b7520f5

Browse files
committed
fix errors in the guide
- `s/(left|right) hand/\1-hand/` - `s/parenthesis/parentheses/` - `s/unicode/Unicode/` - `s/validly-encoded/validly encoded/`
1 parent 61af402 commit b7520f5

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
@@ -683,7 +683,7 @@ fn main() {
683683
```
684684

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

@@ -884,7 +884,7 @@ Tuples are an ordered list of a fixed size. Like this:
884884
let x = (1i, "hello");
885885
```
886886

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
888888
with the type annotated:
889889

890890
```rust
@@ -908,9 +908,9 @@ let (x, y, z) = (1i, 2i, 3i);
908908
println!("x is {}", x);
909909
```
910910

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

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

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
14571457
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
14591459
and can contain null bytes.
14601460

14611461
Rust has two main types of strings: `&str` and `String`.
@@ -3933,7 +3933,7 @@ match x {
39333933
}
39343934
```
39353935

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

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

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

0 commit comments

Comments
 (0)