Skip to content

Commit c820a52

Browse files
authored
Rollup merge of #77399 - ssomers:btree_cleanup_5, r=Mark-Simulacrum
BTreeMap: use Unique::from to avoid a cast where type information exists r? @Mark-Simulacrum
2 parents fbb3dd4 + 4243475 commit c820a52

File tree

1 file changed

+1
-1
lines changed
  • library/alloc/src/collections/btree

1 file changed

+1
-1
lines changed

library/alloc/src/collections/btree/node.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ impl<K, V> BoxedNode<K, V> {
128128
}
129129

130130
fn from_internal(node: Box<InternalNode<K, V>>) -> Self {
131-
BoxedNode { ptr: Box::into_unique(node).cast() }
131+
BoxedNode { ptr: Unique::from(&mut Box::leak(node).data) }
132132
}
133133

134134
unsafe fn from_ptr(ptr: NonNull<LeafNode<K, V>>) -> Self {

0 commit comments

Comments
 (0)