Skip to content

Commit b8fc3c7

Browse files
committed
Fixing lint message and provide docs.
1 parent 6fa1fef commit b8fc3c7

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

clippy_lints/src/single_component_use_path.rs

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,25 @@ use if_chain::if_chain;
66
use rustc_errors::Applicability;
77

88
declare_clippy_lint! {
9+
/// **What it does:** Checking for imports with single component use path.
10+
///
11+
/// **Why is this bad?** Import with single component use path such as `use cratename;`
12+
/// is not necessary in order to use the crate.
13+
///
14+
/// **Known problems:** None.
15+
///
16+
/// **Example:**
17+
///
18+
/// ```rust, ignore
19+
/// use bit_vec;
20+
///
21+
/// fn main() {
22+
/// bit_vec::BitVec::new();
23+
///}
24+
///```
925
pub SINGLE_COMPONENT_USE_PATH,
1026
style,
11-
"use with single component path is redundant in 2018 edition"
27+
"use with single component path is redundant"
1228
}
1329

1430
declare_lint_pass!(SingleComponentUsePath => [SINGLE_COMPONENT_USE_PATH]);
@@ -24,7 +40,7 @@ impl EarlyLintPass for SingleComponentUsePath {
2440
cx,
2541
SINGLE_COMPONENT_USE_PATH,
2642
item.span,
27-
"this import is redundant in 2018 edition",
43+
"this import is redundant",
2844
"remove it entirely",
2945
"".to_string(),
3046
Applicability::MachineApplicable

0 commit comments

Comments
 (0)