From 54c41c049cbfdd159a713ba4ac87056f6b5c7488 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Kr=C3=BCger?= Date: Wed, 4 Aug 2021 00:21:25 +0200 Subject: [PATCH] needless_borrow: try to make lint example a bit more illustrating --- clippy_lints/src/needless_borrow.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/clippy_lints/src/needless_borrow.rs b/clippy_lints/src/needless_borrow.rs index 3f0b23ee4..ba8f9446a 100644 --- a/clippy_lints/src/needless_borrow.rs +++ b/clippy_lints/src/needless_borrow.rs @@ -27,11 +27,15 @@ declare_clippy_lint! { /// /// ### Example /// ```rust + /// fn fun(_a: &i32) {} + /// /// // Bad /// let x: &i32 = &&&&&&5; + /// fun(&x); /// /// // Good /// let x: &i32 = &5; + /// fun(x); /// ``` pub NEEDLESS_BORROW, style,