Messages in this thread | | | Date | Wed, 14 Jun 2023 16:37:42 +0200 | Subject | Re: [PATCH] rust: make `UnsafeCell` the outer type in `Opaque` | From | Alice Ryhl <> |
| |
On 6/14/23 16:27, Benno Lossin wrote:>> @@ -258,7 +258,7 @@ pub fn ffi_init(init_func: impl FnOnce(*mut T)) -> impl PinInit<Self> { >> >> /// Returns a raw pointer to the opaque data. >> pub fn get(&self) -> *mut T { >> - UnsafeCell::raw_get(self.0.as_ptr()) >> + UnsafeCell::get(&self.0).cast::<T>() > > Is there a reason you don't do `self.0.get().cast::<T>()`? >
Not really. I just modified what was already there.
| |