Skip to content

Commit 8a7dcdf

Browse files
authored
Merge pull request #472 from wesleywiser/patch-2
Fix the example code in the const prop blog post
2 parents 6665696 + 5d78d1b commit 8a7dcdf

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

posts/inside-rust/2019-12-02-const-prop-on-by-default.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,18 +47,18 @@ The constant propagation pass also handles propagating into control flow.
4747
For example:
4848

4949
```rust
50-
const Foo: Option<u8> = B(12);
50+
const Foo: Option<u8> = Some(12);
5151

5252
let x = match Foo {
53-
Bar::A => panic!("no value"),
54-
Bar::B(v) => v,
53+
None => panic!("no value"),
54+
Some(v) => v,
5555
};
5656
```
5757

5858
becomes:
5959

6060
```rust
61-
const Foo: Option<u8> = B(12);
61+
const Foo: Option<u8> = Some(12);
6262

6363
let x = 12;
6464
```

0 commit comments

Comments
 (0)