From dfba9a9015dc15a632638c9c7de9ee88367fbfd9 Mon Sep 17 00:00:00 2001 From: Juniper Tyree <50025784+juntyr@users.noreply.github.com> Date: Sat, 2 Nov 2024 06:52:34 +0000 Subject: [PATCH] Fix clippy errors --- src/de/mod.rs | 6 +++--- src/parse.rs | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/de/mod.rs b/src/de/mod.rs index cd568856..e5ed836f 100644 --- a/src/de/mod.rs +++ b/src/de/mod.rs @@ -259,10 +259,10 @@ impl<'de> Deserializer<'de> { .map_err(|err| { struct_error_name( err, - if !name_for_pretty_errors_only.is_empty() { - Some(name_for_pretty_errors_only) - } else { + if name_for_pretty_errors_only.is_empty() { None + } else { + Some(name_for_pretty_errors_only) }, ) })? diff --git a/src/parse.rs b/src/parse.rs index f3553390..8cf7caa5 100644 --- a/src/parse.rs +++ b/src/parse.rs @@ -573,11 +573,11 @@ impl<'a> Parser<'a> { match parser.peek_char() { // Definitely a struct with named fields Some(':') => { - if parser.exts.contains(Extensions::BRACED_STRUCTS) { - return Err(Error::ExpectedStructLike); + return if parser.exts.contains(Extensions::BRACED_STRUCTS) { + Err(Error::ExpectedStructLike) } else { - return Ok(StructType::Named); - } + Ok(StructType::Named) + }; } // Definitely a braced struct with named fields Some('{') if parser.exts.contains(Extensions::BRACED_STRUCTS) => {