]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/src/docs/single_component_path_imports.txt
Auto merge of #104673 - matthiaskrgr:rollup-85f65ov, r=matthiaskrgr
[rust.git] / src / tools / clippy / src / docs / single_component_path_imports.txt
1 ### What it does
2 Checking for imports with single component use path.
3
4 ### Why is this bad?
5 Import with single component use path such as `use cratename;`
6 is not necessary, and thus should be removed.
7
8 ### Example
9 ```
10 use regex;
11
12 fn main() {
13     regex::Regex::new(r"^\d{4}-\d{2}-\d{2}$").unwrap();
14 }
15 ```
16 Better as
17 ```
18 fn main() {
19     regex::Regex::new(r"^\d{4}-\d{2}-\d{2}$").unwrap();
20 }
21 ```