Skip to content

Commit bbe58b2

Browse files
authored
Merge pull request #3252 from SteveLauC/add-missing-code-highlight
add missing code syntax highlight to RFC 2005
2 parents dd71b24 + 6f9d43d commit bbe58b2

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

text/2005-match-ergonomics.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Better ergonomics for pattern-matching on references.
1111
Currently, matching on references requires a bit of a dance using
1212
`ref` and `&` patterns:
1313

14-
```
14+
```rust
1515
let x: &Option<_> = &Some(0);
1616

1717
match x {
@@ -29,7 +29,7 @@ match *x {
2929

3030
After this RFC, the above form still works, but now we also allow a simpler form:
3131

32-
```
32+
```rust
3333
let x: &Option<_> = &Some(0);
3434

3535
match x {
@@ -62,7 +62,7 @@ instead of helping.
6262

6363
For example, consider the following program:
6464

65-
```
65+
```rust
6666
enum E { Foo(...), Bar }
6767

6868
fn f(e: &E) {
@@ -74,7 +74,7 @@ fn f(e: &E) {
7474
It is clear what we want to do here - we want to check which variant `e` is a
7575
reference to. Annoyingly, we have two valid choices:
7676

77-
```
77+
```rust
7878
match e {
7979
&E::Foo(...) => { ... }
8080
&E::Bar => { ... }
@@ -83,7 +83,7 @@ match e {
8383

8484
and
8585

86-
```
86+
```rust
8787
match *e {
8888
E::Foo(...) => { ... }
8989
E::Bar => { ... }
@@ -99,7 +99,7 @@ duration of the match. It also does not work with nested types, `match (*e,)
9999
In either case if we further bind variables, we must ensure that we do not
100100
attempt to move data, e.g.,
101101

102-
```
102+
```rust
103103
match *e {
104104
E::Foo(x) => { ... }
105105
E::Bar => { ... }

0 commit comments

Comments
 (0)