Skip to content

Commit 2dbf0c1

Browse files
committed
Auto merge of #7528 - matthiaskrgr:nedlbrw, r=Manishearth
needless_borrow: try to make lint example a bit more illustrating changelog: none
2 parents 8556910 + 54c41c0 commit 2dbf0c1

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

clippy_lints/src/needless_borrow.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,15 @@ declare_clippy_lint! {
2727
///
2828
/// ### Example
2929
/// ```rust
30+
/// fn fun(_a: &i32) {}
31+
///
3032
/// // Bad
3133
/// let x: &i32 = &&&&&&5;
34+
/// fun(&x);
3235
///
3336
/// // Good
3437
/// let x: &i32 = &5;
38+
/// fun(x);
3539
/// ```
3640
pub NEEDLESS_BORROW,
3741
style,

0 commit comments

Comments
 (0)