Skip to content

Commit 7ebca87

Browse files
mgeislergribozavr
andauthored
docs: improve language in pattern-matching section (#2879)
I asked Gemini to review the English for inconsistencies and grammar mistakes. This is the result and I hope it's useful! As a non-native speaker, it is hard for me to evaluate the finer details, so let me know if you would like to see changes (or even better: make them directly in the PR with the suggestion function). --------- Co-authored-by: Dmitri Gribenko <gribozavr@gmail.com>
1 parent 2679581 commit 7ebca87

File tree

6 files changed

+7
-7
lines changed

6 files changed

+7
-7
lines changed

src/pattern-matching/destructuring-structs.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ minutes: 4
44

55
# Structs
66

7-
Like tuples, Struct can also be destructured by matching:
7+
Like tuples, structs can also be destructured by matching:
88

99
```rust,editable
1010
{{#include ../../third_party/rust-by-example/destructuring-structs.rs}}

src/pattern-matching/exercise.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ to `30`. We can represent the expression as a tree:
2222
```
2323

2424
A bigger and more complex expression would be `(10 * 9) + ((3 - 4) * 5)`, which
25-
evaluate to `85`. We represent this as a much bigger tree:
25+
evaluates to `85`. We represent this as a much bigger tree:
2626

2727
<!-- mdbook-xgettext: skip -->
2828

src/pattern-matching/infallible.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ fn main() {
3737
- Patterns are type-specific, including irrefutable patterns. Try adding or
3838
removing an element to the tuple and look at the resulting compiler errors.
3939

40-
- Variable names are patterns that always match and which bind the matched value
41-
into a new variable with that name.
40+
- Variable names are patterns that always match and bind the matched value into
41+
a new variable with that name.
4242

4343
- `_` is a pattern that always matches any value, discarding the matched value.
4444

src/pattern-matching/let-control-flow.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ minutes: 10
44

55
# Let Control Flow
66

7-
Rust has a few control flow constructs which differ from other languages. They
7+
Rust has a few control flow constructs that differ from other languages. They
88
are used for pattern matching:
99

1010
- `if let` expressions

src/pattern-matching/let-control-flow/while-let.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Like with `if let`, there is a
44
[`while let`](https://doc.rust-lang.org/reference/expressions/loop-expr.html#predicate-pattern-loops)
5-
variant which repeatedly tests a value against a pattern:
5+
variant that repeatedly tests a value against a pattern:
66

77
```rust,editable
88
fn main() {

src/pattern-matching/match.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Key Points:
3535
- You might point out how some specific characters are being used when in a
3636
pattern
3737
- `|` as an `or`
38-
- `..` can expand as much as it needs to be
38+
- `..` matches any number of items
3939
- `1..=5` represents an inclusive range
4040
- `_` is a wild card
4141

0 commit comments

Comments
 (0)