Skip to content

Commit

Permalink
book: match enum warning removed
Browse files Browse the repository at this point in the history
Matching enums with named fields in the previous way yielded the "non_shorthand_field_patterns" warning.
The new code shows the shorthand syntax as well as field renaming, so it should be exhaustive ;-)
  • Loading branch information
Constantin committed Jan 3, 2017
1 parent 1659d65 commit e7d60c0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/doc/book/match.md
Expand Up @@ -82,7 +82,7 @@ fn process_message(msg: Message) {
match msg {
Message::Quit => quit(),
Message::ChangeColor(r, g, b) => change_color(r, g, b),
Message::Move { x: x, y: y } => move_cursor(x, y),
Message::Move { x, y: new_name_for_y } => move_cursor(x, new_name_for_y),
Message::Write(s) => println!("{}", s),
};
}
Expand Down

0 comments on commit e7d60c0

Please sign in to comment.