From 989ebae2ba5b79e259ee6267a390acd446cb5bff Mon Sep 17 00:00:00 2001 From: alexey semenyuk Date: Thu, 29 Aug 2024 10:55:42 +0500 Subject: [PATCH] Provide more clear example for WRONG_SELF_CONVENTION --- clippy_lints/src/methods/mod.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/clippy_lints/src/methods/mod.rs b/clippy_lints/src/methods/mod.rs index d7126990e..e1f1df4ee 100644 --- a/clippy_lints/src/methods/mod.rs +++ b/clippy_lints/src/methods/mod.rs @@ -441,6 +441,17 @@ declare_clippy_lint! { /// } /// } /// ``` + /// + /// Use instead: + /// ```no_run + /// # struct X; + /// impl X { + /// fn as_str(&self) -> &'static str { + /// // .. + /// # "" + /// } + /// } + /// ``` #[clippy::version = "pre 1.29.0"] pub WRONG_SELF_CONVENTION, style,