RS.CLIPPY.SINGLE_COMPONENT_PATH_IMPORTS

Imports with single component path are redundant

This checker is a Clippy lint created by The Rust Project Contributors. The documentation shown here is a copy of the original documentation for: single_component_path_imports. Copyright ©2025 The Rust Team. All rights reserved.

What it does

Checking for imports with single component use path.

Why is this bad?

Import with single component use path such as use cratename; is not necessary, and thus should be removed.

Example

use regex;

fn main() {
    regex::Regex::new(r"^\\d{4}-\\d{2}-\\d{2}$").unwrap();
}

Better as

fn main() {
    regex::Regex::new(r"^\\d{4}-\\d{2}-\\d{2}$").unwrap();
}