BTreeMap: use Unique::from to avoid a cast where type information exists

This commit is contained in:
Stein Somers 2020-09-26 20:49:22 +02:00
parent fc42fb8e70
commit 424347527d
1 changed files with 1 additions and 1 deletions

View File

@ -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 {