2020-01-15 00:56:56 -06:00
|
|
|
error: this match could be written as a `let` statement
|
2020-03-27 14:36:00 -05:00
|
|
|
--> $DIR/match_single_binding.rs:28:5
|
2020-01-15 00:56:56 -06:00
|
|
|
|
|
|
|
|
LL | / match (a, b, c) {
|
|
|
|
LL | | (x, y, z) => {
|
|
|
|
LL | | println!("{} {} {}", x, y, z);
|
|
|
|
LL | | },
|
|
|
|
LL | | }
|
2020-01-19 04:07:13 -06:00
|
|
|
| |_____^
|
2020-01-15 00:56:56 -06:00
|
|
|
|
|
|
|
|
= note: `-D clippy::match-single-binding` implied by `-D warnings`
|
2020-01-19 04:07:13 -06:00
|
|
|
help: consider using `let` statement
|
|
|
|
|
|
|
|
|
LL | let (x, y, z) = (a, b, c);
|
2020-02-05 02:55:48 -06:00
|
|
|
LL | {
|
|
|
|
LL | println!("{} {} {}", x, y, z);
|
|
|
|
LL | }
|
2020-01-19 04:07:13 -06:00
|
|
|
|
|
2020-01-15 00:56:56 -06:00
|
|
|
|
2020-01-26 10:03:39 -06:00
|
|
|
error: this match could be written as a `let` statement
|
2020-03-27 14:36:00 -05:00
|
|
|
--> $DIR/match_single_binding.rs:34:5
|
2020-01-26 10:03:39 -06:00
|
|
|
|
|
|
|
|
LL | / match (a, b, c) {
|
|
|
|
LL | | (x, y, z) => println!("{} {} {}", x, y, z),
|
|
|
|
LL | | }
|
|
|
|
| |_____^
|
|
|
|
|
|
|
|
|
help: consider using `let` statement
|
|
|
|
|
|
|
|
|
LL | let (x, y, z) = (a, b, c);
|
2020-02-05 02:55:48 -06:00
|
|
|
LL | println!("{} {} {}", x, y, z);
|
2020-01-26 10:03:39 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
error: this match could be replaced by its body itself
|
2020-03-27 14:36:00 -05:00
|
|
|
--> $DIR/match_single_binding.rs:51:5
|
2020-01-26 10:03:39 -06:00
|
|
|
|
|
|
|
|
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
|
2020-03-27 14:36:00 -05:00
|
|
|
--> $DIR/match_single_binding.rs:55:5
|
2020-01-26 10:03:39 -06:00
|
|
|
|
|
|
|
|
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 | {
|
2020-02-05 02:55:48 -06:00
|
|
|
LL | let x = 29;
|
|
|
|
LL | println!("x has a value of {}", x);
|
|
|
|
LL | }
|
2020-01-26 10:03:39 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
error: this match could be replaced by its body itself
|
2020-03-27 14:36:00 -05:00
|
|
|
--> $DIR/match_single_binding.rs:62:5
|
2020-01-26 10:03:39 -06:00
|
|
|
|
|
|
|
|
LL | / match a {
|
|
|
|
LL | | _ => {
|
|
|
|
LL | | let e = 5 * a;
|
|
|
|
LL | | if e >= 5 {
|
|
|
|
... |
|
|
|
|
LL | | },
|
|
|
|
LL | | }
|
|
|
|
| |_____^
|
|
|
|
|
|
|
|
|
help: consider using the match body instead
|
|
|
|
|
|
|
|
|
LL | {
|
2020-02-05 02:55:48 -06:00
|
|
|
LL | let e = 5 * a;
|
|
|
|
LL | if e >= 5 {
|
|
|
|
LL | println!("e is superior to 5");
|
|
|
|
LL | }
|
2020-01-26 10:03:39 -06:00
|
|
|
LL | }
|
|
|
|
|
|
|
|
|
|
|
|
|
error: this match could be written as a `let` statement
|
2020-03-27 14:36:00 -05:00
|
|
|
--> $DIR/match_single_binding.rs:72:5
|
2020-01-26 10:03:39 -06:00
|
|
|
|
|
|
|
|
LL | / match p {
|
|
|
|
LL | | Point { x, y } => println!("Coords: ({}, {})", x, y),
|
|
|
|
LL | | }
|
|
|
|
| |_____^
|
|
|
|
|
|
|
|
|
help: consider using `let` statement
|
|
|
|
|
|
|
|
|
LL | let Point { x, y } = p;
|
2020-02-05 02:55:48 -06:00
|
|
|
LL | println!("Coords: ({}, {})", x, y);
|
2020-01-26 10:03:39 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
error: this match could be written as a `let` statement
|
2020-03-27 14:36:00 -05:00
|
|
|
--> $DIR/match_single_binding.rs:76:5
|
2020-01-26 10:03:39 -06:00
|
|
|
|
|
|
|
|
LL | / match p {
|
|
|
|
LL | | Point { x: x1, y: y1 } => println!("Coords: ({}, {})", x1, y1),
|
|
|
|
LL | | }
|
|
|
|
| |_____^
|
|
|
|
|
|
|
|
|
help: consider using `let` statement
|
|
|
|
|
|
|
|
|
LL | let Point { x: x1, y: y1 } = p;
|
2020-02-05 02:55:48 -06:00
|
|
|
LL | println!("Coords: ({}, {})", x1, y1);
|
2020-01-26 10:03:39 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
error: this match could be written as a `let` statement
|
2020-03-27 14:36:00 -05:00
|
|
|
--> $DIR/match_single_binding.rs:81:5
|
2020-01-26 10:03:39 -06:00
|
|
|
|
|
|
|
|
LL | / match x {
|
|
|
|
LL | | ref r => println!("Got a reference to {}", r),
|
|
|
|
LL | | }
|
|
|
|
| |_____^
|
|
|
|
|
|
|
|
|
help: consider using `let` statement
|
|
|
|
|
|
|
|
|
LL | let ref r = x;
|
2020-02-05 02:55:48 -06:00
|
|
|
LL | println!("Got a reference to {}", r);
|
2020-01-26 10:03:39 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
error: this match could be written as a `let` statement
|
2020-03-27 14:36:00 -05:00
|
|
|
--> $DIR/match_single_binding.rs:86:5
|
2020-01-26 10:03:39 -06:00
|
|
|
|
|
|
|
|
LL | / match x {
|
|
|
|
LL | | ref mut mr => println!("Got a mutable reference to {}", mr),
|
|
|
|
LL | | }
|
|
|
|
| |_____^
|
|
|
|
|
|
|
|
|
help: consider using `let` statement
|
|
|
|
|
|
|
|
|
LL | let ref mut mr = x;
|
2020-02-05 02:55:48 -06:00
|
|
|
LL | println!("Got a mutable reference to {}", mr);
|
2020-01-26 10:03:39 -06:00
|
|
|
|
|
|
|
|
|
2020-03-08 16:57:35 -05:00
|
|
|
error: this match could be written as a `let` statement
|
2020-03-27 14:36:00 -05:00
|
|
|
--> $DIR/match_single_binding.rs:90:5
|
2020-03-08 16:57:35 -05:00
|
|
|
|
|
|
|
|
LL | / let product = match coords() {
|
|
|
|
LL | | Point { x, y } => x * y,
|
|
|
|
LL | | };
|
|
|
|
| |______^
|
|
|
|
|
|
|
|
|
help: consider using `let` statement
|
|
|
|
|
|
|
|
|
LL | let Point { x, y } = coords();
|
|
|
|
LL | let product = x * y;
|
|
|
|
|
|
|
|
|
|
2020-03-21 14:26:55 -05:00
|
|
|
error: this match could be written as a `let` statement
|
2020-03-27 14:36:00 -05:00
|
|
|
--> $DIR/match_single_binding.rs:98:18
|
2020-03-21 14:26:55 -05:00
|
|
|
|
|
|
|
|
LL | .map(|i| match i.unwrap() {
|
|
|
|
| __________________^
|
|
|
|
LL | | unwrapped => unwrapped,
|
|
|
|
LL | | })
|
|
|
|
| |_________^
|
|
|
|
|
|
|
|
|
help: consider using `let` statement
|
|
|
|
|
|
|
|
|
LL | .map(|i| {
|
|
|
|
LL | let unwrapped = i.unwrap();
|
|
|
|
LL | unwrapped
|
|
|
|
LL | })
|
|
|
|
|
|
|
|
|
|
2021-04-16 02:07:20 -05:00
|
|
|
error: aborting due to 11 previous errors
|
2020-01-15 00:56:56 -06:00
|
|
|
|