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