BTreeMap: use Unique::from to avoid a cast where type information exists
This commit is contained in:
parent
fc42fb8e70
commit
424347527d
@ -128,7 +128,7 @@ impl<K, V> BoxedNode<K, V> {
|
||||
}
|
||||
|
||||
fn from_internal(node: Box<InternalNode<K, V>>) -> Self {
|
||||
BoxedNode { ptr: Box::into_unique(node).cast() }
|
||||
BoxedNode { ptr: Unique::from(&mut Box::leak(node).data) }
|
||||
}
|
||||
|
||||
unsafe fn from_ptr(ptr: NonNull<LeafNode<K, V>>) -> Self {
|
||||
|
Loading…
x
Reference in New Issue
Block a user