Skip to content

Commit

Permalink
Minor cleanup of implicit_return
Browse files Browse the repository at this point in the history
  • Loading branch information
Jarcho committed Apr 22, 2021
1 parent ef9ad80 commit 3d793f3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions clippy_lints/src/implicit_return.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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
}
}

Expand Down

0 comments on commit 3d793f3

Please sign in to comment.