diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2022-01-14 07:47:37 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-01-14 07:47:37 +0100 |
| commit | d7024acb3287d4dbde9f49c2e0c8c44c59fe365f (patch) | |
| tree | a17d99aabd3aaf23a4e7ddc196173fa3b96c5d42 /clippy_lints/src/trailing_empty_array.rs | |
| parent | 2e3b64deef7f70ff95b7ecb8270297fe04876ddd (diff) | |
| parent | 7e267c23d64f8a6c72d0d71cce5284f70376ea13 (diff) | |
Rollup merge of #92849 - flip1995:clippyup, r=Manishearth
Clippyup r? ```@Manishearth```
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); |
