Skip to content

Commit 7b192e0

Browse files
committed
Rename last case of UseLast to GetLastWithLen
1 parent 9314ae2 commit 7b192e0

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

clippy_lints/src/get_last_with_len.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ declare_clippy_lint! {
4242
"Using `x.get(x.len() - 1)` when `x.last()` is correct and simpler"
4343
}
4444

45-
declare_lint_pass!(UseLast => [GET_LAST_WITH_LEN]);
45+
declare_lint_pass!(GetLastWithLen => [GET_LAST_WITH_LEN]);
4646

47-
impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UseLast {
47+
impl<'a, 'tcx> LateLintPass<'a, 'tcx> for GetLastWithLen {
4848
fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr) {
4949
if_chain! {
5050
// Is a method call

clippy_lints/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -492,6 +492,7 @@ pub fn register_plugins(reg: &mut rustc_plugin::Registry<'_>, conf: &Conf) {
492492
reg.register_late_lint_pass(box types::CharLitAsU8);
493493
reg.register_late_lint_pass(box vec::UselessVec);
494494
reg.register_late_lint_pass(box drop_bounds::DropBounds);
495+
reg.register_late_lint_pass(box get_last_with_len::GetLastWithLen);
495496
reg.register_late_lint_pass(box drop_forget_ref::DropForgetRef);
496497
reg.register_late_lint_pass(box empty_enum::EmptyEnum);
497498
reg.register_late_lint_pass(box types::AbsurdExtremeComparisons);

0 commit comments

Comments
 (0)