Skip to content

Commit ec346e4

Browse files
committed
Fix match in union example.
I think the intent here is to match on the variant. The current example is binding variables named "I" and "F".
1 parent 6cf18ff commit ec346e4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/items/unions.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,8 @@ struct Value {
119119
fn is_zero(v: Value) -> bool {
120120
unsafe {
121121
match v {
122-
Value { tag: I, u: U { i: 0 } } => true,
123-
Value { tag: F, u: U { f: num } } if num == 0.0 => true,
122+
Value { tag: Tag::I, u: U { i: 0 } } => true,
123+
Value { tag: Tag::F, u: U { f: num } } if num == 0.0 => true,
124124
_ => false,
125125
}
126126
}

0 commit comments

Comments
 (0)