error: this match could be written as a `let` statement --> $DIR/match_single_binding.rs:34:5 | LL | / match (a, b, c) { LL | | (x, y, z) => { LL | | println!("{} {} {}", x, y, z); LL | | }, LL | | } | |_____^ | = note: `-D clippy::match-single-binding` implied by `-D warnings` help: consider using a `let` statement | LL ~ let (x, y, z) = (a, b, c); LL + { LL + println!("{} {} {}", x, y, z); LL + } | error: this match could be written as a `let` statement --> $DIR/match_single_binding.rs:40:5 | LL | / match (a, b, c) { LL | | (x, y, z) => println!("{} {} {}", x, y, z), LL | | } | |_____^ | help: consider using a `let` statement | LL ~ let (x, y, z) = (a, b, c); LL + println!("{} {} {}", x, y, z); | error: this match could be replaced by its body itself --> $DIR/match_single_binding.rs:57:5 | LL | / match a { LL | | _ => println!("whatever"), LL | | } | |_____^ help: consider using the match body instead: `println!("whatever");` error: this match could be replaced by its body itself --> $DIR/match_single_binding.rs:61:5 | LL | / match a { LL | | _ => { LL | | let x = 29; LL | | println!("x has a value of {}", x); LL | | }, LL | | } | |_____^ | help: consider using the match body instead | LL ~ { LL + let x = 29; LL + println!("x has a value of {}", x); LL + } | error: this match could be replaced by its body itself --> $DIR/match_single_binding.rs:68:5 | LL | / match a { LL | | _ => { LL | | let e = 5 * a; LL | | if e >= 5 { ... | LL | | }, LL | | } | |_____^ | help: consider using the match body instead | LL ~ { LL + let e = 5 * a; LL + if e >= 5 { LL + println!("e is superior to 5"); LL + } LL + } | error: this match could be written as a `let` statement --> $DIR/match_single_binding.rs:78:5 | LL | / match p { LL | | Point { x, y } => println!("Coords: ({}, {})", x, y), LL | | } | |_____^ | help: consider using a `let` statement | LL ~ let Point { x, y } = p; LL + println!("Coords: ({}, {})", x, y); | error: this match could be written as a `let` statement --> $DIR/match_single_binding.rs:82:5 | LL | / match p { LL | | Point { x: x1, y: y1 } => println!("Coords: ({}, {})", x1, y1), LL | | } | |_____^ | help: consider using a `let` statement | LL ~ let Point { x: x1, y: y1 } = p; LL + println!("Coords: ({}, {})", x1, y1); | error: this match could be written as a `let` statement --> $DIR/match_single_binding.rs:87:5 | LL | / match x { LL | | ref r => println!("Got a reference to {}", r), LL | | } | |_____^ | help: consider using a `let` statement | LL ~ let ref r = x; LL + println!("Got a reference to {}", r); | error: this match could be written as a `let` statement --> $DIR/match_single_binding.rs:92:5 | LL | / match x { LL | | ref mut mr => println!("Got a mutable reference to {}", mr), LL | | } | |_____^ | help: consider using a `let` statement | LL ~ let ref mut mr = x; LL + println!("Got a mutable reference to {}", mr); | error: this match could be written as a `let` statement --> $DIR/match_single_binding.rs:96:5 | LL | / let product = match coords() { LL | | Point { x, y } => x * y, LL | | }; | |______^ | help: consider using a `let` statement | LL ~ let Point { x, y } = coords(); LL + let product = x * y; | error: this match could be written as a `let` statement --> $DIR/match_single_binding.rs:104:18 | LL | .map(|i| match i.unwrap() { | __________________^ LL | | unwrapped => unwrapped, LL | | }) | |_________^ | help: consider using a `let` statement | LL ~ .map(|i| { LL + let unwrapped = i.unwrap(); LL + unwrapped LL ~ }) | error: this match could be replaced by its body itself --> $DIR/match_single_binding.rs:130:5 | LL | / match x { LL | | // => LL | | _ => println!("Not an array index start"), LL | | } | |_____^ help: consider using the match body instead: `println!("Not an array index start")` error: this assignment could be simplified --> $DIR/match_single_binding.rs:139:5 | LL | / val = match val.split_at(idx) { LL | | (pre, suf) => { LL | | println!("{}", pre); LL | | suf LL | | }, LL | | }; | |_____^ | help: consider removing the `match` expression | LL ~ let (pre, suf) = val.split_at(idx); LL + val = { LL + println!("{}", pre); LL + suf LL ~ }; | error: this match could be replaced by its scrutinee and body --> $DIR/match_single_binding.rs:152:16 | LL | let _ = || match side_effects() { | ________________^ LL | | _ => println!("Needs curlies"), LL | | }; | |_____^ | help: consider using the scrutinee and body instead | LL ~ let _ = || { LL + side_effects(); LL + println!("Needs curlies") LL ~ }; | error: this match could be written as a `let` statement --> $DIR/match_single_binding.rs:158:5 | LL | / match r { LL | | x => match x { LL | | Some(_) => { LL | | println!("Some"); ... | LL | | }, LL | | }; | |_____^ | help: consider using a `let` statement | LL ~ let x = r; LL + match x { LL + Some(_) => { LL + println!("Some"); LL + }, LL + None => { LL + println!("None"); LL + }, LL ~ }; | error: this match could be replaced by its body itself --> $DIR/match_single_binding.rs:171:5 | LL | / match 1 { LL | | _ => (), LL | | } | |_____^ help: consider using the match body instead: `();` error: this match could be replaced by its body itself --> $DIR/match_single_binding.rs:175:13 | LL | let a = match 1 { | _____________^ LL | | _ => (), LL | | }; | |_____^ help: consider using the match body instead: `()` error: this match could be replaced by its body itself --> $DIR/match_single_binding.rs:179:5 | LL | / match 1 { LL | | _ => side_effects(), LL | | } | |_____^ help: consider using the match body instead: `side_effects();` error: this match could be replaced by its body itself --> $DIR/match_single_binding.rs:183:13 | LL | let b = match 1 { | _____________^ LL | | _ => side_effects(), LL | | }; | |_____^ help: consider using the match body instead: `side_effects()` error: this match could be replaced by its body itself --> $DIR/match_single_binding.rs:187:5 | LL | / match 1 { LL | | _ => println!("1"), LL | | } | |_____^ help: consider using the match body instead: `println!("1");` error: this match could be replaced by its body itself --> $DIR/match_single_binding.rs:191:13 | LL | let c = match 1 { | _____________^ LL | | _ => println!("1"), LL | | }; | |_____^ help: consider using the match body instead: `println!("1")` error: this match could be replaced by its body itself --> $DIR/match_single_binding.rs:196:9 | LL | / match 1 { LL | | _ => (), LL | | }, | |_________^ help: consider using the match body instead: `()` error: this match could be replaced by its body itself --> $DIR/match_single_binding.rs:199:9 | LL | / match 1 { LL | | _ => side_effects(), LL | | }, | |_________^ help: consider using the match body instead: `side_effects()` error: this match could be replaced by its body itself --> $DIR/match_single_binding.rs:202:9 | LL | / match 1 { LL | | _ => println!("1"), LL | | }, | |_________^ help: consider using the match body instead: `println!("1")` error: aborting due to 24 previous errors