diff options
| author | flip1995 <philipp.krones@embecosm.com> | 2022-01-13 13:18:19 +0100 |
|---|---|---|
| committer | flip1995 <philipp.krones@embecosm.com> | 2022-01-13 13:18:19 +0100 |
| commit | fb0142ae41a49a4dda6bc0c7487efa00818c8f49 (patch) | |
| tree | 0b51b29d80477019cca389c9b053d0d04c8d74ee /clippy_lints/src/trailing_empty_array.rs | |
| parent | dda2aef64fb5b4903a28e5d4fb8d63483642cc6f (diff) | |
| download | rust-fb0142ae41a49a4dda6bc0c7487efa00818c8f49.tar.gz rust-fb0142ae41a49a4dda6bc0c7487efa00818c8f49.zip | |
Merge commit '97a5daa65908e59744e2bc625b14849352231c75' into clippyup
Diffstat (limited to 'clippy_lints/src/trailing_empty_array.rs')
| -rw-r--r-- | clippy_lints/src/trailing_empty_array.rs | 5 |
1 files changed, 2 insertions, 3 deletions
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); |
