rust: rbtree: simplify finding `current` in `remove_current`
authorOnur Özkan <work@onurozkan.dev>
Tue, 8 Jul 2025 07:58:50 +0000 (10:58 +0300)
committerMiguel Ojeda <ojeda@kernel.org>
Mon, 14 Jul 2025 21:53:35 +0000 (23:53 +0200)
commitb6f885060e8e24f1a1a9205ba41a0524964e8c30
tree8537883f621f26eaefcd339aa76cc5e7069f9131
parent8ffb945647f8740e2eab81ace8c87f9734c85f95
rust: rbtree: simplify finding `current` in `remove_current`

The previous version used a verbose `match` to get
`current`, which may be slightly confusing at first
glance.

This change makes it shorter and more clearly expresses
the intent: prefer `next` if available, otherwise fall
back to `prev`.

Signed-off-by: Onur Özkan <work@onurozkan.dev>
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Reviewed-by: Alexandre Courbot <acourbot@nvidia.com>
Link: https://lore.kernel.org/r/20250708075850.25789-1-work@onurozkan.dev
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
rust/kernel/rbtree.rs