]> git.hungrycats.org Git - linux/commit
rust: ptr: use `match` instead of `unwrap_or_else` for `build_index`
authorGary Guo <gary@garyguo.net>
Tue, 2 Jun 2026 14:17:53 +0000 (15:17 +0100)
committerMiguel Ojeda <ojeda@kernel.org>
Fri, 5 Jun 2026 08:11:23 +0000 (10:11 +0200)
commit4dda19120a93a559681205fe0476908d8356d52c
tree5c60e05d8fbbb2bb8e9c50ff1641bc214dd64834
parent735bc1c843101aa2383061acb73d3824c7a66e11
rust: ptr: use `match` instead of `unwrap_or_else` for `build_index`

Use `match` to avoid potential inlining issues of the `unwrap_or_else`
function.

Suggested-by: Alice Ryhl <aliceryhl@google.com>
Link: https://lore.kernel.org/rust-for-linux/aeCKlut-88SbNsyW@google.com/
Signed-off-by: Gary Guo <gary@garyguo.net>
Reviewed-by: Alexandre Courbot <acourbot@nvidia.com>
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Acked-by: Danilo Krummrich <dakr@kernel.org>
Link: https://patch.msgid.link/20260602-projection-syntax-rework-v2-2-6989470f5440@garyguo.net
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
rust/kernel/ptr/projection.rs