diff options
| author | Constantin <github.8.enormator@xoxy.net> | 2017-01-03 07:19:45 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-01-03 07:19:45 +0100 |
| commit | e7d60c00c68e72fa954bcff311bc92e1c445823c (patch) | |
| tree | eaf1d4043b389d722d340e2f1429775b6fb41a23 /src | |
| parent | 1659d65e0323707646854d6993da31690f855f0e (diff) | |
| download | rust-e7d60c00c68e72fa954bcff311bc92e1c445823c.tar.gz rust-e7d60c00c68e72fa954bcff311bc92e1c445823c.zip | |
book: match enum warning removed
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 ;-)
Diffstat (limited to 'src')
| -rw-r--r-- | src/doc/book/match.md | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/doc/book/match.md b/src/doc/book/match.md index d01a20083ef..52d3c6ae926 100644 --- a/src/doc/book/match.md +++ b/src/doc/book/match.md @@ -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), }; } |
