fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

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