diff --git a/clippy_lints/src/get_last_with_len.rs b/clippy_lints/src/get_last_with_len.rs index 4a26c788fb9d..d6b739e77909 100644 --- a/clippy_lints/src/get_last_with_len.rs +++ b/clippy_lints/src/get_last_with_len.rs @@ -60,8 +60,14 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for GetLastWithLen { // Argument to "get" is a subtraction if let Some(get_index_arg) = args.get(1); - if let ExprKind::Binary(Spanned{node: BinOpKind::Sub, ..}, - lhs, rhs) = &get_index_arg.node; + if let ExprKind::Binary( + Spanned { + node: BinOpKind::Sub, + .. + }, + lhs, + rhs, + ) = &get_index_arg.node; // LHS of subtraction is "x.len()" if let ExprKind::MethodCall(arg_lhs_path, _, lhs_args) = &lhs.node; @@ -91,7 +97,8 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for GetLastWithLen { &format!("accessing last element with `{0}.get({0}.len() - 1)`", vec_name), "try", format!("{}.last()", vec_name), - applicability); + applicability, + ); } } }