Rust

Rust

Made by DeepSource

Found redundant type annotation RS-C1016

Anti-pattern
Minor
Autofix

Using underscores for type annotation does not change the semantics of the code and adds unnecessary noise, reducing readability. The underscore can simply be omitted as the type of the variable would still be inferred from context by default.

Bad practice

fn foo() {
    let a: _ = 0;
}

Recommended

fn foo() {
    let a = 0;
}