From fb0142ae41a49a4dda6bc0c7487efa00818c8f49 Mon Sep 17 00:00:00 2001 From: flip1995 Date: Thu, 13 Jan 2022 13:18:19 +0100 Subject: Merge commit '97a5daa65908e59744e2bc625b14849352231c75' into clippyup --- clippy_lints/src/trailing_empty_array.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'clippy_lints/src/trailing_empty_array.rs') diff --git a/clippy_lints/src/trailing_empty_array.rs b/clippy_lints/src/trailing_empty_array.rs index af36f726700..c9b2ce476e8 100644 --- a/clippy_lints/src/trailing_empty_array.rs +++ b/clippy_lints/src/trailing_empty_array.rs @@ -53,13 +53,12 @@ impl<'tcx> LateLintPass<'tcx> for TrailingEmptyArray { } } -fn is_struct_with_trailing_zero_sized_array(cx: &LateContext<'tcx>, item: &'tcx Item<'tcx>) -> bool { +fn is_struct_with_trailing_zero_sized_array(cx: &LateContext<'_>, item: &Item<'_>) -> bool { if_chain! { // First check if last field is an array if let ItemKind::Struct(data, _) = &item.kind; if let Some(last_field) = data.fields().last(); - if let rustc_hir::TyKind::Array(_, length) = last_field.ty.kind; - if let rustc_hir::ArrayLen::Body(length) = length; + if let rustc_hir::TyKind::Array(_, rustc_hir::ArrayLen::Body(length)) = last_field.ty.kind; // Then check if that that array zero-sized let length_ldid = cx.tcx.hir().local_def_id(length.hir_id); -- cgit 1.4.1-3-g733a5