error: This else block is redundant.
- --> $DIR/needless_continue.rs:26:16
+ --> $DIR/needless_continue.rs:36:16
|
-26 | } else {
+LL | } else {
| ________________^
-27 | | continue;
-28 | | }
+LL | | continue;
+LL | | }
| |_________^
|
- = note: `-D needless-continue` implied by `-D warnings`
+ = note: `-D clippy::needless-continue` implied by `-D warnings`
= help: Consider dropping the else clause and merging the code that follows (in the loop) with the if block, like so:
if i % 2 == 0 && i % 3 == 0 {
println!("{}", i);
- println!("{}", i+1);
+ println!("{}", i + 1);
if i % 5 == 0 {
- println!("{}", i+2);
+ println!("{}", i + 2);
}
let i = 0;
println!("bar {} ", i);
error: There is no need for an explicit `else` block for this `if` expression
- --> $DIR/needless_continue.rs:41:9
+ --> $DIR/needless_continue.rs:51:9
|
-41 | / if (zero!(i % 2) || nonzero!(i % 5)) && i % 3 != 0 {
-42 | | continue;
-43 | | } else {
-44 | | println!("Blabber");
-45 | | println!("Jabber");
-46 | | }
+LL | / if (zero!(i % 2) || nonzero!(i % 5)) && i % 3 != 0 {
+LL | | continue;
+LL | | } else {
+LL | | println!("Blabber");
+LL | | println!("Jabber");
+LL | | }
| |_________^
|
= help: Consider dropping the else clause, and moving out the code in the else block, like so:
println!("Jabber");
...
+error: aborting due to 2 previous errors
+