Skip to content

Commit

Permalink
Touch up early return in Enum checks
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Jul 3, 2023
1 parent c0ba323 commit b053b4f
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions serde_derive/src/internals/check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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() {
Expand Down

0 comments on commit b053b4f

Please sign in to comment.