Skip to content

Commit 42d849c

Browse files
committed
Formatting inside if_chain! macro
1 parent f32c2fc commit 42d849c

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

clippy_lints/src/get_last_with_len.rs

+10-3
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,14 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for GetLastWithLen {
6060

6161
// Argument to "get" is a subtraction
6262
if let Some(get_index_arg) = args.get(1);
63-
if let ExprKind::Binary(Spanned{node: BinOpKind::Sub, ..},
64-
lhs, rhs) = &get_index_arg.node;
63+
if let ExprKind::Binary(
64+
Spanned {
65+
node: BinOpKind::Sub,
66+
..
67+
},
68+
lhs,
69+
rhs,
70+
) = &get_index_arg.node;
6571

6672
// LHS of subtraction is "x.len()"
6773
if let ExprKind::MethodCall(arg_lhs_path, _, lhs_args) = &lhs.node;
@@ -91,7 +97,8 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for GetLastWithLen {
9197
&format!("accessing last element with `{0}.get({0}.len() - 1)`", vec_name),
9298
"try",
9399
format!("{}.last()", vec_name),
94-
applicability);
100+
applicability,
101+
);
95102
}
96103
}
97104
}

0 commit comments

Comments
 (0)