File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 11# Enums
22
33The ` 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
55an ` 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.
1212enum 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`.
You can’t perform that action at this time.
0 commit comments