[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAH5fLggDQzNx_uxT+Yw1tMP3fHZSRWTN0RcQEb40bcPL6KgT5A@mail.gmail.com>
Date: Thu, 5 Sep 2024 10:08:30 +0200
From: Alice Ryhl <aliceryhl@...gle.com>
To: Miguel Ojeda <ojeda@...nel.org>
Cc: Alex Gaynor <alex.gaynor@...il.com>, Wedson Almeida Filho <wedsonaf@...il.com>,
Boqun Feng <boqun.feng@...il.com>, Gary Guo <gary@...yguo.net>,
Björn Roy Baron <bjorn3_gh@...tonmail.com>,
Benno Lossin <benno.lossin@...ton.me>, Andreas Hindborg <a.hindborg@...sung.com>,
Trevor Gross <tmgross@...ch.edu>, rust-for-linux@...r.kernel.org,
linux-kernel@...r.kernel.org, patches@...ts.linux.dev
Subject: Re: [PATCH 07/19] rust: enable `clippy::ignored_unit_patterns` lint
On Wed, Sep 4, 2024 at 10:45 PM Miguel Ojeda <ojeda@...nel.org> wrote:
>
> In Rust 1.73.0, Clippy introduced the `ignored_unit_patterns` lint [1]:
>
> > Matching with `()` explicitly instead of `_` outlines the fact that
> > the pattern contains no data. Also it would detect a type change
> > that `_` would ignore.
>
> There is only a single case that requires a change:
>
> error: matching over `()` is more explicit
> --> rust/kernel/types.rs:176:45
> |
> 176 | ScopeGuard::new_with_data((), move |_| cleanup())
> | ^ help: use `()` instead of `_`: `()`
> |
> = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ignored_unit_patterns
> = note: requested on the command line with `-D clippy::ignored-unit-patterns`
>
> Thus clean it up and enable the lint -- no functional change intended.
>
> Link: https://rust-lang.github.io/rust-clippy/master/index.html#/ignored_unit_patterns [1]
> Signed-off-by: Miguel Ojeda <ojeda@...nel.org>
Reviewed-by: Alice Ryhl <aliceryhl@...gle.com>
Powered by blists - more mailing lists