Skip to content
This repository was archived by the owner on Jun 8, 2021. It is now read-only.

Commit 4636d62

Browse files
Update boxed.rs
Fixup implementation of FromGlibPtrFull<*const T>. uses simple cast now
1 parent 4aff48a commit 4636d62

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/boxed.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -470,9 +470,8 @@ impl<T: 'static, MM: BoxedMemoryManager<T>> FromGlibPtrFull<*const T> for Boxed<
470470
#[inline]
471471
unsafe fn from_glib_full(ptr: *const T) -> Self {
472472
assert!(!ptr.is_null());
473-
let ptr = MM::copy(ptr);
474473
Boxed {
475-
inner: AnyBox::Native(Box::from_raw(ptr)),
474+
inner: AnyBox::ForeignOwned(ptr::NonNull::new_unchecked(ptr as *mut _)),
476475
_dummy: PhantomData,
477476
}
478477
}

0 commit comments

Comments
 (0)