Use #[derive(Default)] instead of manually implementing it
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user