Resolve clippy warnings

This commit is contained in:
Graham Esau 2023-08-20 17:19:53 +01:00
parent e0495c0c87
commit 072730f6f6
6 changed files with 15 additions and 18 deletions

View file

@ -69,10 +69,7 @@ impl<'a> Variant<'a> {
}
pub fn is_unit(&self) -> bool {
match self.style {
serde_ast::Style::Unit => true,
_ => false,
}
matches!(self.style, serde_ast::Style::Unit)
}
}

View file

@ -190,8 +190,7 @@ impl Attrs {
}
pub fn is_default(&self) -> bool {
match self {
Self {
matches!(self, Self {
with: None,
title: None,
description: None,
@ -200,9 +199,7 @@ impl Attrs {
repr: None,
crate_name: None,
is_renamed: _,
} if examples.is_empty() => true,
_ => false,
}
} if examples.is_empty())
}
}

View file

@ -1,5 +1,6 @@
#![allow(clippy::all)]
// Copied from regex_syntax crate to avoid pulling in the whole crate just for a utility function
// https://github.com/rust-lang/regex/blob/ff283badce21dcebd581909d38b81f2c8c9bfb54/regex-syntax/src/lib.rs
// https://github.com/rust-lang/regex/blob/431c4e4867e1eb33eb39b23ed47c9934b2672f8f/regex-syntax/src/lib.rs
//
// Copyright (c) 2014 The Rust Project Developers
//