Skip to content

Commit d15838c

Browse files
committed
Use borrow (&) instead of ref keyword
1 parent 8e3301d commit d15838c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

clippy_lints/src/use_last.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,18 +61,18 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UseLast {
6161
// Argument to "get" is a subtraction
6262
if let Some(get_index_arg) = args.get(1);
6363
if let ExprKind::Binary(Spanned{node: BinOpKind::Sub, span: _},
64-
ref lhs, ref rhs) = get_index_arg.node;
64+
lhs, rhs) = &get_index_arg.node;
6565

6666
// LHS of subtraction is "x.len()"
67-
if let ExprKind::MethodCall(ref arg_lhs_path, _, ref lhs_args) = lhs.node;
67+
if let ExprKind::MethodCall(arg_lhs_path, _, lhs_args) = &lhs.node;
6868
if arg_lhs_path.ident.name == Symbol::intern("len");
6969
if let Some(arg_lhs_struct) = lhs_args.get(0);
7070

7171
// The two vectors referenced (x in x.get(...) and in x.len())
7272
if SpanlessEq::new(cx).eq_expr(struct_calling_on, arg_lhs_struct);
7373

7474
// RHS of subtraction is 1
75-
if let ExprKind::Lit(ref rhs_lit) = rhs.node;
75+
if let ExprKind::Lit(rhs_lit) = &rhs.node;
7676
if let LitKind::Int(rhs_value, ..) = rhs_lit.node;
7777
if rhs_value == 1;
7878

0 commit comments

Comments
 (0)