]> git.lizzy.rs Git - rust.git/commitdiff
Minor cleanup of `implicit_return`
authorJason Newcomb <jsnewcomb@pm.me>
Thu, 22 Apr 2021 13:11:36 +0000 (09:11 -0400)
committerJason Newcomb <jsnewcomb@pm.me>
Thu, 22 Apr 2021 13:36:49 +0000 (09:36 -0400)
clippy_lints/src/implicit_return.rs

index 39612dbf05004d5f9c7414ca986352a188b213d4..30174fa2100dbbd2f259bbb7e8de3e9ac2ebed87 100644 (file)
@@ -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
     }
 }