dylint

inconsistent_qualification

What it does

Checks that a module’s items are either imported or qualified with the module’s path, but not both.

Why is this bad?

Mixing the two styles can lead to confusing code.

Known problems

Example

use std::env::var;
fn main() {
    assert_eq!(var("LD_PRELOAD"), Err(std::env::VarError::NotPresent));
}

Instead, either use:

use std::env::{var, VarError};
fn main() {
    assert_eq!(var("LD_PRELOAD"), Err(VarError::NotPresent));
}

Or use:

fn main() {
    assert_eq!(
        std::env::var("LD_PRELOAD"),
        Err(std::env::VarError::NotPresent)
    );
}