Use #[derive(Default)]
instead of manually implementing it
This commit is contained in:
parent
e108481f74
commit
1f82b45b6a
8 changed files with 16 additions and 77 deletions
|
@ -1023,6 +1023,7 @@ declare_lint! {
|
|||
"`if`, `match`, `while` and `return` do not need parentheses"
|
||||
}
|
||||
|
||||
#[derive(Default)]
|
||||
pub(crate) struct UnusedParens {
|
||||
with_self_ty_parens: bool,
|
||||
/// `1 as (i32) < 2` parses to ExprKind::Lt
|
||||
|
@ -1030,12 +1031,6 @@ pub(crate) struct UnusedParens {
|
|||
parens_in_cast_in_lt: Vec<ast::NodeId>,
|
||||
}
|
||||
|
||||
impl Default for UnusedParens {
|
||||
fn default() -> Self {
|
||||
Self { with_self_ty_parens: false, parens_in_cast_in_lt: Vec::new() }
|
||||
}
|
||||
}
|
||||
|
||||
impl_lint_pass!(UnusedParens => [UNUSED_PARENS]);
|
||||
|
||||
impl UnusedDelimLint for UnusedParens {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue