]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
rust: macros: simplify code using `feature(extract_if)`
authorMiguel Ojeda <ojeda@kernel.org>
Sun, 5 Apr 2026 23:52:51 +0000 (01:52 +0200)
committerMiguel Ojeda <ojeda@kernel.org>
Tue, 7 Apr 2026 08:00:24 +0000 (10:00 +0200)
commit42ec980024f03bad6fd97d65c22f6cf32fb08c58
treebb0bbdb391f263d63d501b816cae664f12692ca8
parent161dd7b51e9699a5d1bb2cb24a7eaca23e0facad
rust: macros: simplify code using `feature(extract_if)`

`feature(extract_if)` [1] was stabilized in Rust 1.87.0 [2], and the last
significant change happened in Rust 1.85.0 [3] when the range parameter
was added.

That is, with our new minimum version, we can start using the feature.

Thus simplify the code using the feature and remove the TODO comment.

Suggested-by: Gary Guo <gary@garyguo.net>
Link: https://lore.kernel.org/rust-for-linux/DHHVSX66206Y.3E7I9QUNTCJ8I@garyguo.net/
Link: https://github.com/rust-lang/rust/issues/43244
Link: https://github.com/rust-lang/rust/pull/137109
Link: https://github.com/rust-lang/rust/pull/133265
Link: https://patch.msgid.link/20260405235309.418950-16-ojeda@kernel.org
Reviewed-by: Tamir Duberstein <tamird@kernel.org>
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
rust/macros/kunit.rs
rust/macros/lib.rs