Skip to content

Commit

Permalink
needless_borrow: try to make lint example a bit more illustrating
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiaskrgr committed Aug 3, 2021
1 parent 77af56d commit 54c41c0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions clippy_lints/src/needless_borrow.rs
Expand Up @@ -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,
Expand Down

0 comments on commit 54c41c0

Please sign in to comment.