Minor cleanup of implicit_return

This commit is contained in:
Jason Newcomb 2021-04-22 09:11:36 -04:00
parent ef9ad80617
commit 3d793f3111
No known key found for this signature in database
GPG key ID: DA59E8643A37ED06

View file

@ -70,6 +70,7 @@ fn lint_break(cx: &LateContext<'_>, break_span: Span, expr_span: Span) {
) )
} }
#[derive(Clone, Copy, PartialEq, Eq)]
enum LintLocation { enum LintLocation {
/// The lint was applied to a parent expression. /// The lint was applied to a parent expression.
Parent, Parent,
@ -81,8 +82,8 @@ impl LintLocation {
if b { self } else { Self::Inner } if b { self } else { Self::Inner }
} }
fn is_parent(&self) -> bool { fn is_parent(self) -> bool {
matches!(*self, Self::Parent) self == Self::Parent
} }
} }