Skip to content

Commit 60ddb60

Browse files
committed
Merge branch 'use_last' of github.com:HarrisonMc555/rust-clippy into use_last
2 parents a74055b + 7f4896f commit 60ddb60

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

clippy_lints/src/get_last_with_len.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -81,13 +81,14 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for GetLastWithLen {
8181
let vec_name = snippet_with_applicability(
8282
cx,
8383
struct_calling_on.span, "vec",
84-
&mut applicability);
84+
&mut applicability,
85+
);
8586

8687
span_lint_and_sugg(
8788
cx,
8889
GET_LAST_WITH_LEN,
8990
expr.span,
90-
&format!("accessing last element with `{}.get({}.len() - 1)`",
91+
&format!("accessing last element with `{0}.get({0}.len() - 1)`", vec_name),
9192
vec_name,
9293
vec_name),
9394
"try",

0 commit comments

Comments
 (0)