Re: [PATCH 7/7] drm/panic: allow verbose version check

From: Miguel Ojeda
Date: Sat Oct 12 2024 - 07:08:42 EST


On Sat, Oct 12, 2024 at 9:54 AM Thomas Böhler <witcher@xxxxxxxxxxxxx> wrote:
>
> Clippy warns about a reimplementation of `RangeInclusive::contains`:
>
> error: manual `!RangeInclusive::contains` implementation
> --> drivers/gpu/drm/drm_panic_qr.rs:986:8
> |
> 986 | if version < 1 || version > 40 {
> | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `!(1..=40).contains(&version)`
> |
> = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains
> = note: `-D clippy::manual-range-contains` implied by `-D warnings`
> = help: to override `-D warnings` add `#[allow(clippy::manual_range_contains)]`
>
> Ignore this and keep the current implementation as that makes it easier
> to read.

Yeah, I wonder if we may want to disable globally this one (and
possibly the previous one too) -- I am ambivalent.

> + #[allow(clippy::manual_range_contains)]

This (and the previous one) may be good candidates for `#[expect]`. We
don't have that yet in mainline, but it is in `rust-next`, so we can
clean it up next cycle.

Cheers,
Miguel