Skip to content

Commit

Permalink
doctest
Browse files Browse the repository at this point in the history
  • Loading branch information
lengyijun committed Nov 7, 2024
1 parent 2b6e8a9 commit 2a70749
Showing 1 changed file with 20 additions and 9 deletions.
29 changes: 20 additions & 9 deletions clippy_lints/src/use_crate_prefix_for_self_imports.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,30 @@ declare_clippy_lint! {
/// This helps reduce confusion and maintain a uniform codebase.
///
/// ### Example
/// ```no_run
/// mod foo {
/// pub fn bar(){}
/// }
/// use foo::bar; // foo is a module in the current crate
/// ```rust,ignore
/// // lib.rs
/// mod foo;
/// use foo::bar;
/// ```
///
/// ```rust,ignore
/// // foo.rs
/// #[path = "./foo.rs"]
/// pub fn bar() {}
/// ```
///
/// Use instead:
/// ```no_run
/// mod foo {
/// pub fn bar(){}
/// }
/// ```rust,ignore
/// // lib.rs
/// mod foo;
/// use crate::foo::bar;
/// ```
///
/// ```rust,ignore
/// // foo.rs
/// #[path = "./foo.rs"]
/// pub fn bar() {}
/// ```
#[clippy::version = "1.84.0"]
pub USE_CRATE_PREFIX_FOR_SELF_IMPORTS,
style,
Expand Down

0 comments on commit 2a70749

Please sign in to comment.