]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/tests/ui/match_single_binding2.stderr
Rollup merge of #84221 - ABouttefeux:generic-arg-elision, r=estebank
[rust.git] / src / tools / clippy / tests / ui / match_single_binding2.stderr
1 error: this match could be written as a `let` statement
2   --> $DIR/match_single_binding2.rs:18:36
3    |
4 LL |               Some((iter, _item)) => match iter.size_hint() {
5    |  ____________________________________^
6 LL | |                 (min, max) => (min.saturating_add(1), max.and_then(|max| max.checked_add(1))),
7 LL | |             },
8    | |_____________^
9    |
10    = note: `-D clippy::match-single-binding` implied by `-D warnings`
11 help: consider using `let` statement
12    |
13 LL |             Some((iter, _item)) => {
14 LL |                 let (min, max) = iter.size_hint();
15 LL |                 (min.saturating_add(1), max.and_then(|max| max.checked_add(1)))
16 LL |             },
17    |
18
19 error: this match could be written as a `let` statement
20   --> $DIR/match_single_binding2.rs:31:13
21    |
22 LL | /             match get_tup() {
23 LL | |                 (a, b) => println!("a {:?} and b {:?}", a, b),
24 LL | |             }
25    | |_____________^
26    |
27 help: consider using `let` statement
28    |
29 LL |             let (a, b) = get_tup();
30 LL |             println!("a {:?} and b {:?}", a, b);
31    |
32
33 error: this match could be replaced by its scrutinee and body
34   --> $DIR/match_single_binding2.rs:42:5
35    |
36 LL | /     match side_effects() {
37 LL | |         _ => println!("Side effects"),
38 LL | |     }
39    | |_____^
40    |
41 help: consider using the scrutinee and body instead
42    |
43 LL |     side_effects();
44 LL |     println!("Side effects");
45    |
46
47 error: this match could be replaced by its scrutinee and body
48   --> $DIR/match_single_binding2.rs:49:5
49    |
50 LL | /     match match x {
51 LL | |         0 => 1,
52 LL | |         _ => 2,
53 LL | |     } {
54 LL | |         _ => println!("Single branch"),
55 LL | |     }
56    | |_____^
57    |
58 help: consider using the scrutinee and body instead
59    |
60 LL |     match x {
61 LL |         0 => 1,
62 LL |         _ => 2,
63 LL |     };
64 LL |     println!("Single branch");
65    |
66
67 error: aborting due to 4 previous errors
68