Messages in this thread | | | From | Wedson Almeida Filho <> | Date | Sat, 23 Sep 2023 11:07:25 -0300 | Subject | Re: [PATCH 2/2] rust: arc: remove `ArcBorrow` in favour of `WithRef` |
| |
On Fri, 22 Sept 2023 at 16:50, Benno Lossin <benno.lossin@proton.me> wrote: > > On 22.09.23 17:29, Alice Ryhl wrote: > > On Thu, Sep 21, 2023 at 11:35 PM Wedson Almeida Filho > > <wedsonaf@gmail.com> wrote: > >> > >> From: Wedson Almeida Filho <walmeida@microsoft.com> > >> > >> 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@gmail.com> > >> Signed-off-by: Boqun Feng <boqun.feng@gmail.com> > >> Signed-off-by: Wedson Almeida Filho <walmeida@microsoft.com> > > > > 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. > > I think `WithArc` would be confusing, since `Arc` is the smartpointer > that points to a `WithRef`.
I find `WithArc` confusing as well: is it a `T` with an `Arc`?. And I agree that with Martin's point that it being in the `arc` module should (although feebly) establish the relationship with `Arc`.
I'm not married to the `WithRef` name, but so far it's been the best option I've seen.
| |