CAD97/thin-dst

Add `Arc::get_mut` and friends

Closed this issue · 2 comments

Looks like it's impossible to express get_mut using the present API. However, I seem to need it for "allocate nodes directly in the Arc, and fix the total length later".

Alternatively, provide an unsafe fn from_arc(arc: Arc<ThinData<Head, SliceItem>>) -> ThinArc<Head, SliceItem>.

CAD97 commented

We have both impl<Head, SliceItem> From<Arc<ThinData<Head, SliceItem>>> for ThinArc<Head, SliceItem> and impl<Head, SliceItem> Into<Arc<ThinData<Head, SliceItem>>> for ThinArc<Head, SliceItem> already, so you can already transform between Arc<ThinData<Head, SliceItem>> into ThinArc<Head, SliceItem> freely, can you not?

doh, missed the From impl inside the macro 😅