diff options
| author | Jason Newcomb <jsnewcomb@pm.me> | 2021-04-22 09:11:36 -0400 |
|---|---|---|
| committer | Jason Newcomb <jsnewcomb@pm.me> | 2021-04-22 09:36:49 -0400 |
| commit | 3d793f3111845c8d5836310387b65622ea86b01f (patch) | |
| tree | d78e9223e5eef137192b693fe1e53bc2f9b2d9cb | |
| parent | ef9ad806179665cce9c5813db369038d84291fd8 (diff) | |
| download | rust-3d793f3111845c8d5836310387b65622ea86b01f.tar.gz rust-3d793f3111845c8d5836310387b65622ea86b01f.zip | |
Minor cleanup of `implicit_return`
| -rw-r--r-- | clippy_lints/src/implicit_return.rs | 5 |
1 files 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 @@ 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 } } |
