Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 26b1d60

Browse files
committed
Add test and update reference.
1 parent 512efbe commit 26b1d60

File tree

3 files changed

+34
-0
lines changed

3 files changed

+34
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// run-rustfix
2+
// compile-flags: --edition 2018
3+
#![warn(clippy::single_component_path_imports)]
4+
#![allow(unused_imports)]
5+
6+
7+
use serde as edres;
8+
pub use serde;
9+
10+
fn main() {
11+
regex::Regex::new(r"^\d{4}-\d{2}-\d{2}$").unwrap();
12+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// run-rustfix
2+
// compile-flags: --edition 2018
3+
#![warn(clippy::single_component_path_imports)]
4+
#![allow(unused_imports)]
5+
6+
use regex;
7+
use serde as edres;
8+
pub use serde;
9+
10+
fn main() {
11+
regex::Regex::new(r"^\d{4}-\d{2}-\d{2}$").unwrap();
12+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
error: this import is redundant
2+
--> $DIR/single_component_path_imports.rs:6:1
3+
|
4+
LL | use regex;
5+
| ^^^^^^^^^^ help: remove it entirely
6+
|
7+
= note: `-D clippy::single-component-path-imports` implied by `-D warnings`
8+
9+
error: aborting due to previous error
10+

0 commit comments

Comments
 (0)