Re: [PATCH 6/6] rust: rbtree: add `RBTree::entry`

From: Alice Ryhl
Date: Fri Feb 09 2024 - 08:07:55 EST


On Mon, Feb 5, 2024 at 4:50 PM <mattgilbride@xxxxxxxxxx> wrote:
>
> From: Alice Ryhl <aliceryhl@xxxxxxxxxx>
>
> This mirrors the entry API [1] from the Rust standard library on
> `RBTree`. This API can be used to access the entry at a specific key and
> make modifications depending on whether the key is vacant or occupied.
> This API is useful because it can often be used to avoid traversing the
> tree multiple times.
>
> This is used by binder to look up and conditionally access or insert a
> value, depending on whether it is there or not [2].
>
> Link: https://doc.rust-lang.org/stable/std/collections/btree_map/enum.Entry.html [1]
> Link: https://android-review.googlesource.com/c/kernel/common/+/2849906 [2]
> Signed-off-by: Alice Ryhl <aliceryhl@xxxxxxxxxx>
> Signed-off-by: Matt Gilbride <mattgilbride@xxxxxxxxxx>

I wrote this patch, so I will not review it, but I have used it in
Rust Binder, so:

Tested-by: Alice Ryhl <aliceryhl@xxxxxxxxxx>