File tree 1 file changed +3
-3
lines changed 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 1
1
# Enums
2
2
3
3
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
5
5
an ` enum ` .
6
6
7
7
``` rust,editable
@@ -10,7 +10,7 @@ an `enum`.
10
10
// `PageLoad != PageUnload` and `KeyPress(char) != Paste(String)`.
11
11
// Each is different and independent.
12
12
enum WebEvent {
13
- // An `enum` may either be `unit-like`,
13
+ // An `enum` variant may either be `unit-like`,
14
14
PageLoad,
15
15
PageUnload,
16
16
// like tuple structs,
@@ -26,7 +26,7 @@ fn inspect(event: WebEvent) {
26
26
match event {
27
27
WebEvent::PageLoad => println!("page loaded"),
28
28
WebEvent::PageUnload => println!("page unloaded"),
29
- // Destructure `c` from inside the `enum`.
29
+ // Destructure `c` from inside the `enum` variant .
30
30
WebEvent::KeyPress(c) => println!("pressed '{}'.", c),
31
31
WebEvent::Paste(s) => println!("pasted \"{}\".", s),
32
32
// Destructure `Click` into `x` and `y`.
You can’t perform that action at this time.
0 commit comments