Skip to content

Commit a87d489

Browse files
committed
Nit cleanup
1 parent 8012707 commit a87d489

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

text/0000-match-ergonomics.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -331,8 +331,8 @@ Example using `let`:
331331
struct Foo(i32);
332332

333333
// Note that these rules apply to any pattern matching
334-
// whether it be in a `match` or a `let`. So, for example,
335-
// `x` here is a ref binding:
334+
// whether it be in a `match` or a `let`.
335+
// For example, `x` here is a `ref` binding:
336336
let Foo(x) = &Foo(3);
337337

338338
// Desugared:
@@ -395,7 +395,7 @@ experience more straightforward and requiring fewer manual reference gymnastics.
395395
# Alternatives
396396
[alternatives]: #alternatives
397397

398-
- We could only infer `ref`, leaving users to manually specify the `mut` in
398+
1. We could only infer `ref`, leaving users to manually specify the `mut` in
399399
`ref mut` bindings. This has the advantage of keeping mutability explicit.
400400
Unfortunately, it also has some unintuitive results. `ref mut` doesn't actually
401401
produce mutable bindings-- it produces immutably-bound mutable references.
@@ -440,12 +440,12 @@ Forcing users to manually specify `mut` in reference bindings would
440440
be inconsistent with Rust's current semantics, and would result in confusing
441441
errors.
442442

443-
- We could support auto-ref / deref as suggested in
443+
2. We could support auto-ref / deref as suggested in
444444
[the original match ergonomics RFC.](https://github.com/rust-lang/rfcs/pull/1944)
445445
This approach has troublesome interaction with
446446
backwards-compatibility, and it becomes more difficult for the user to reason
447447
about whether they've borrowed or moved a value.
448-
- We could allow writing `move` in patterns.
448+
3. We could allow writing `move` in patterns.
449449
Without this, `move`, unlike `ref` and `ref mut`, would always be implicit,
450450
leaving no way override a default binding mode of `ref` or `ref mut` and move
451451
the value out from behind a reference.

0 commit comments

Comments
 (0)