From 60814975069b550604d636aa31698e8a1e8a3f40 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Wed, 7 Jun 2023 21:17:16 -0700 Subject: [PATCH] Resolve semicolon_if_nothing_returned pedantic clippy lint error: consider adding a `;` to the last statement for consistent formatting --> serde_derive/src/internals/ast.rs:161:13 | 161 | seen_untagged = variant.attrs.untagged() | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add a `;` here: `seen_untagged = variant.attrs.untagged();` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned = note: `-D clippy::semicolon-if-nothing-returned` implied by `-D clippy::pedantic` error: consider adding a `;` to the last statement for consistent formatting --> serde_derive/src/internals/ast.rs:159:17 | 159 | ... cx.error_spanned_by(&variant.ident, "all variants with the #[serde(untagged)] attribute must be placed at the end of the enum") | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add a `;` here: `cx.error_spanned_by(&variant.ident, "all variants with the #[serde(untagged)] attribute must be placed at the end of the enum");` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned --- serde_derive/src/internals/ast.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/serde_derive/src/internals/ast.rs b/serde_derive/src/internals/ast.rs index ca3dd33ad..b654f7749 100644 --- a/serde_derive/src/internals/ast.rs +++ b/serde_derive/src/internals/ast.rs @@ -156,9 +156,9 @@ fn enum_from_ast<'a>( } }).inspect(|variant| { if !variant.attrs.untagged() && seen_untagged { - cx.error_spanned_by(&variant.ident, "all variants with the #[serde(untagged)] attribute must be placed at the end of the enum") + cx.error_spanned_by(&variant.ident, "all variants with the #[serde(untagged)] attribute must be placed at the end of the enum"); } - seen_untagged = variant.attrs.untagged() + seen_untagged = variant.attrs.untagged(); }).collect() }