Skip to content

Commit 3d793f3

Browse files
committed
Minor cleanup of implicit_return
1 parent ef9ad80 commit 3d793f3

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

clippy_lints/src/implicit_return.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ fn lint_break(cx: &LateContext<'_>, break_span: Span, expr_span: Span) {
7070
)
7171
}
7272

73+
#[derive(Clone, Copy, PartialEq, Eq)]
7374
enum LintLocation {
7475
/// The lint was applied to a parent expression.
7576
Parent,
@@ -81,8 +82,8 @@ impl LintLocation {
8182
if b { self } else { Self::Inner }
8283
}
8384

84-
fn is_parent(&self) -> bool {
85-
matches!(*self, Self::Parent)
85+
fn is_parent(self) -> bool {
86+
self == Self::Parent
8687
}
8788
}
8889

0 commit comments

Comments
 (0)