From b053b4f492b3810c957eae3b1559df16072f8c97 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Sun, 2 Jul 2023 21:08:29 -0700 Subject: [PATCH] Touch up early return in Enum checks --- serde_derive/src/internals/check.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/serde_derive/src/internals/check.rs b/serde_derive/src/internals/check.rs index 05b4b8ff8..28c97bc61 100644 --- a/serde_derive/src/internals/check.rs +++ b/serde_derive/src/internals/check.rs @@ -110,9 +110,7 @@ fn check_flatten_field(cx: &Ctxt, style: Style, field: &Field) { fn check_identifier(cx: &Ctxt, cont: &Container) { let variants = match &cont.data { Data::Enum(variants) => variants, - Data::Struct(_, _) => { - return; - } + Data::Struct(_, _) => return, }; for (i, variant) in variants.iter().enumerate() { @@ -194,9 +192,7 @@ fn check_identifier(cx: &Ctxt, cont: &Container) { fn check_variant_skip_attrs(cx: &Ctxt, cont: &Container) { let variants = match &cont.data { Data::Enum(variants) => variants, - Data::Struct(_, _) => { - return; - } + Data::Struct(_, _) => return, }; for variant in variants.iter() {