needless_borrow: try to make lint example a bit more illustrating
This commit is contained in:
parent
77af56d181
commit
54c41c049c
@ -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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user