Auto merge of #11809 - hrxi:pr_if_same_then_else_style, r=Alexendoo

Change `if_same_then_else` to be a `style` lint

CC #3770

From https://github.com/rust-lang/rust-clippy/issues/3770#issuecomment-687565594 (`@flip1995):`

> Oh I thought I replied to this: I definitely see now that having this
> as a correctness lint might be the wrong categorization. What we might
> want to do is to just allow this lint, if there are comments in the
> arm bodies. But a good first step would be to downgrade this lint to
> style or complexity. I would vote for style since merging two arms is
> not always less complex.

changelog: [`if_same_then_else`]: Change to be a `style` lint
This commit is contained in:
bors 2023-11-15 12:11:14 +00:00
commit 3ea5bcf5ee
2 changed files with 3 additions and 2 deletions

View File

@ -117,7 +117,7 @@
/// ```
#[clippy::version = "pre 1.29.0"]
pub IF_SAME_THEN_ELSE,
correctness,
style,
"`if` with the same `then` and `else` blocks"
}

View File

@ -48,7 +48,8 @@ LL | } else {
LL | | a.field = true;
LL | | }
| |_____^
= note: `#[deny(clippy::if_same_then_else)]` on by default
= note: `-D clippy::if-same-then-else` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::if_same_then_else)]`
error: aborting due to 4 previous errors