Skip to content

Commit

Permalink
Fix clippy errors
Browse files Browse the repository at this point in the history
  • Loading branch information
juntyr committed Nov 2, 2024
1 parent 361ace4 commit dfba9a9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/de/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
},
)
})?
Expand Down
8 changes: 4 additions & 4 deletions src/parse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down

0 comments on commit dfba9a9

Please sign in to comment.