From 664b636cbdcaef6af2b6723de97bf00cf54bc39a Mon Sep 17 00:00:00 2001 From: Chen Rotem Levy Date: Sat, 6 Jan 2018 17:14:06 +0200 Subject: [PATCH] avoid warning: pattern is redundant The restructuring of the `Move` variant uses the long form, and rustc v1.21 warns about it: --> src/main.rs:50:25 | 50 | Message::Move { x: x, y: y } => { | ^^^^ | = note: #[warn(non_shorthand_field_patterns)] on by default Since `struct` shorthand destructing have been introduced above, this warning can go away. If the intention was for this to be an educational experience, this should be kept, but in the case this is an oversight, this PR is here to fix it. --- second-edition/src/ch18-03-pattern-syntax.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/second-edition/src/ch18-03-pattern-syntax.md b/second-edition/src/ch18-03-pattern-syntax.md index fa809dd47..96455ba0f 100644 --- a/second-edition/src/ch18-03-pattern-syntax.md +++ b/second-edition/src/ch18-03-pattern-syntax.md @@ -334,7 +334,7 @@ fn main() { Message::Quit => { println!("The Quit variant has no data to destructure.") }, - Message::Move { x: x, y: y } => { + Message::Move { x, y } => { println!( "Move in the x direction {} and in the y direction {}", x,