Module clippy_lints::needless_continue [] [src]

Checks for continue statements in loops that are redundant.

For example, the lint would catch

while condition() {
    update_condition();
    if x {
        // ...
    } else {
        continue;
    }
    println!("Hello, world");
}

And suggest something like this:

while condition() {
    update_condition();
    if x {
        // ...
        println!("Hello, world");
    }
}

This lint is warn by default.

Structs

NeedlessContinue

Statics

NEEDLESS_CONTINUE

Functions

erode_block

If s contains the code for a block, delimited by braces, this function tries to get the contents of the block. If there is no closing brace present, an empty string is returned.

erode_from_back

Eats at s from the end till a closing brace } is encountered, and then continues eating till a non-whitespace character is found. e.g., the string

erode_from_front

Eats at s from the front by first skipping all leading whitespace. Then, any number of opening braces are eaten, followed by any number of newlines. e.g., the string