Re: [PATCH 2/2] rust: arc: remove `ArcBorrow` in favour of `WithRef`

From: Martin Rodriguez Reboredo
Date: Fri Sep 22 2023 - 18:55:54 EST


On 9/22/23 12:29, Alice Ryhl wrote:
On Thu, Sep 21, 2023 at 11:35 PM Wedson Almeida Filho
<wedsonaf@xxxxxxxxx> wrote:

From: Wedson Almeida Filho <walmeida@xxxxxxxxxxxxx>

With GATs, we don't need a separate type to represent a borrowed object
with a refcount, we can just use Rust's regular shared borrowing. In
this case, we use `&WithRef<T>` instead of `ArcBorrow<'_, T>`.

Co-developed-by: Boqun Feng <boqun.feng@xxxxxxxxx>
Signed-off-by: Boqun Feng <boqun.feng@xxxxxxxxx>
Signed-off-by: Wedson Almeida Filho <walmeida@xxxxxxxxxxxxx>

I wonder whether "WithArc" is a better name? After all, arc is short
for "atomic refcount".
I also think it's nice to include Arc in the name of the type.

Reviewed-by: Alice Ryhl <aliceryhl@xxxxxxxxxx>


It can be read as `arc::WithRef`, which makes sense.