mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-23 21:23:56 +00:00
needless_borrow: try to make lint example a bit more illustrating
This commit is contained in:
parent
77af56d181
commit
54c41c049c
1 changed files with 4 additions and 0 deletions
|
@ -27,11 +27,15 @@ declare_clippy_lint! {
|
||||||
///
|
///
|
||||||
/// ### Example
|
/// ### Example
|
||||||
/// ```rust
|
/// ```rust
|
||||||
|
/// fn fun(_a: &i32) {}
|
||||||
|
///
|
||||||
/// // Bad
|
/// // Bad
|
||||||
/// let x: &i32 = &&&&&&5;
|
/// let x: &i32 = &&&&&&5;
|
||||||
|
/// fun(&x);
|
||||||
///
|
///
|
||||||
/// // Good
|
/// // Good
|
||||||
/// let x: &i32 = &5;
|
/// let x: &i32 = &5;
|
||||||
|
/// fun(x);
|
||||||
/// ```
|
/// ```
|
||||||
pub NEEDLESS_BORROW,
|
pub NEEDLESS_BORROW,
|
||||||
style,
|
style,
|
||||||
|
|
Loading…
Reference in a new issue