Skip to content

Commit 833291d

Browse files
committed
doctest
1 parent 08823cc commit 833291d

File tree

1 file changed

+20
-3
lines changed

1 file changed

+20
-3
lines changed

clippy_lints/src/use_crate_prefix_for_self_imports.rs

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,30 @@ declare_clippy_lint! {
2020
/// This helps reduce confusion and maintain a uniform codebase.
2121
///
2222
/// ### Example
23-
/// ```no_run
24-
/// use foo::bar; // foo is a module in the current crate
23+
/// ```rust,ignore
24+
/// // lib.rs
25+
/// mod foo;
26+
/// use foo::bar;
2527
/// ```
28+
///
29+
/// ```rust,ignore
30+
/// // foo.rs
31+
/// #[path = "./foo.rs"]
32+
/// pub fn bar() {}
33+
/// ```
34+
///
2635
/// Use instead:
27-
/// ```no_run
36+
/// ```rust,ignore
37+
/// // lib.rs
38+
/// mod foo;
2839
/// use crate::foo::bar;
2940
/// ```
41+
///
42+
/// ```rust,ignore
43+
/// // foo.rs
44+
/// #[path = "./foo.rs"]
45+
/// pub fn bar() {}
46+
/// ```
3047
#[clippy::version = "1.84.0"]
3148
pub USE_CRATE_PREFIX_FOR_SELF_IMPORTS,
3249
style,

0 commit comments

Comments
 (0)