From 3d793f3111845c8d5836310387b65622ea86b01f Mon Sep 17 00:00:00 2001 From: Jason Newcomb Date: Thu, 22 Apr 2021 09:11:36 -0400 Subject: [PATCH] Minor cleanup of `implicit_return` --- clippy_lints/src/implicit_return.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/clippy_lints/src/implicit_return.rs b/clippy_lints/src/implicit_return.rs index 39612dbf050..30174fa2100 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 @@ fn still_parent(self, b: bool) -> Self { if b { self } else { Self::Inner } } - fn is_parent(&self) -> bool { - matches!(*self, Self::Parent) + fn is_parent(self) -> bool { + self == Self::Parent } } -- 2.44.0