]> git.lizzy.rs Git - rust.git/blob - tests/ui/needless_continue.stderr
Reduce the hackiness of cargo-clippy
[rust.git] / tests / ui / needless_continue.stderr
1 error: This else block is redundant.
2
3   --> $DIR/needless_continue.rs:26:16
4    |
5 26 |           } else {
6    |  ________________^
7 27 | |             continue;
8 28 | |         }
9    | |_________^
10    |
11    = note: `-D needless-continue` implied by `-D warnings`
12    = help: Consider dropping the else clause and merging the code that follows (in the loop) with the if block, like so:
13            if i % 2 == 0 && i % 3 == 0 {
14            println!("{}", i);
15            println!("{}", i+1);
16            if i % 5 == 0 {
17                println!("{}", i+2);
18            }
19            let i = 0;
20            println!("bar {} ", i);
21            // Merged code follows...println!("bleh");
22            {
23                println!("blah");
24            }
25            if !(!(i == 2) || !(i == 5)) {
26                println!("lama");
27            }
28            if (zero!(i % 2) || nonzero!(i % 5)) && i % 3 != 0 {
29                continue;
30            } else {
31                println!("Blabber");
32                println!("Jabber");
33            }
34            println!("bleh");
35            }
36            
37
38 error: There is no need for an explicit `else` block for this `if` expression
39
40   --> $DIR/needless_continue.rs:41:9
41    |
42 41 | /         if (zero!(i % 2) || nonzero!(i % 5)) && i % 3 != 0 {
43 42 | |             continue;
44 43 | |         } else {
45 44 | |             println!("Blabber");
46 45 | |             println!("Jabber");
47 46 | |         }
48    | |_________^
49    |
50    = help: Consider dropping the else clause, and moving out the code in the else block, like so:
51            if (zero!(i % 2) || nonzero!(i % 5)) && i % 3 != 0 {
52                continue;
53            }
54            println!("Blabber");
55            println!("Jabber");
56            ...
57