Skip to content

Commit 29aea33

Browse files
committed
Improve needless_borrow lint.
* Lint when a borrow is auto dereferenced more than once * Lint when the expression is used as the expression of a block for a match arm Moves `needless_borrow` and `ref_binding_to_reference` to `dereference` lint pass in preperation for `explicit_auto_deref` lint.
1 parent f51fb34 commit 29aea33

11 files changed

+422
-306
lines changed

clippy_lints/src/bytecount.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,10 @@ impl<'tcx> LateLintPass<'tcx> for ByteCount {
7474
if (p == sym::iter || p == sym!(iter_mut)) && args.len() == 1 {
7575
&args[0]
7676
} else {
77-
&filter_recv
77+
filter_recv
7878
}
7979
} else {
80-
&filter_recv
80+
filter_recv
8181
};
8282
let mut applicability = Applicability::MaybeIncorrect;
8383
span_lint_and_sugg(

0 commit comments

Comments
 (0)