Skip to content

Commit ccc5c70

Browse files
authored
Merge pull request #1645 from h-h-h-h/patch-1
Update enum.md
2 parents 251eeb2 + 417ad75 commit ccc5c70

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/custom_types/enum.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Enums
22

33
The `enum` keyword allows the creation of a type which may be one of a few
4-
different variants. Any variant which is valid as a `struct` is also valid as
4+
different variants. Any variant which is valid as a `struct` is also valid in
55
an `enum`.
66

77
```rust,editable
@@ -10,7 +10,7 @@ an `enum`.
1010
// `PageLoad != PageUnload` and `KeyPress(char) != Paste(String)`.
1111
// Each is different and independent.
1212
enum WebEvent {
13-
// An `enum` may either be `unit-like`,
13+
// An `enum` variant may either be `unit-like`,
1414
PageLoad,
1515
PageUnload,
1616
// like tuple structs,
@@ -26,7 +26,7 @@ fn inspect(event: WebEvent) {
2626
match event {
2727
WebEvent::PageLoad => println!("page loaded"),
2828
WebEvent::PageUnload => println!("page unloaded"),
29-
// Destructure `c` from inside the `enum`.
29+
// Destructure `c` from inside the `enum` variant.
3030
WebEvent::KeyPress(c) => println!("pressed '{}'.", c),
3131
WebEvent::Paste(s) => println!("pasted \"{}\".", s),
3232
// Destructure `Click` into `x` and `y`.

0 commit comments

Comments
 (0)