Skip to content

Commit 4b13355

Browse files
committed
Use into_raw_with_allocator
1 parent 14106f7 commit 4b13355

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

agb/src/refcount.rs

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,16 @@ impl<T, A: Allocator> RefCount<T, A> {
2222

2323
pub fn new_in(value: T, a: A) -> Self {
2424
let v = unsafe {
25-
NonNull::new_unchecked(Box::into_raw(Box::new_in(
26-
RefCountInner {
27-
inner: value,
28-
count: Cell::new(1),
29-
},
30-
&a,
31-
)))
25+
NonNull::new_unchecked(
26+
Box::into_raw_with_allocator(Box::new_in(
27+
RefCountInner {
28+
inner: value,
29+
count: Cell::new(1),
30+
},
31+
&a,
32+
))
33+
.0,
34+
)
3235
};
3336
Self(v, a)
3437
}

0 commit comments

Comments
 (0)