Skip to content

Commit 12b4629

Browse files
authored
Rollup merge of rust-lang#38794 - ConnyOnny:master, r=steveklabnik
book: match enum warning 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 ;-)
2 parents 7bfe5c0 + e7d60c0 commit 12b4629

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/doc/book/match.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ fn process_message(msg: Message) {
8282
match msg {
8383
Message::Quit => quit(),
8484
Message::ChangeColor(r, g, b) => change_color(r, g, b),
85-
Message::Move { x: x, y: y } => move_cursor(x, y),
85+
Message::Move { x, y: new_name_for_y } => move_cursor(x, new_name_for_y),
8686
Message::Write(s) => println!("{}", s),
8787
};
8888
}

0 commit comments

Comments
 (0)