@@ -86,13 +86,11 @@ impl<K, V> LeafNode<K, V> {
8686 /// Creates a new boxed `LeafNode`.
8787 fn new < A : Allocator + Clone > ( alloc : A ) -> Box < Self , A > {
8888 let mut leaf = Box :: new_uninit_in ( alloc) ;
89- // SAFETY: Untriaged.
90- unsafe {
91- // SAFETY: `leaf` points to a `LeafNode`
92- LeafNode :: init ( leaf. as_mut_ptr ( ) ) ;
93- // SAFETY: `leaf` was just initialized
94- leaf. assume_init ( )
95- }
89+
90+ // SAFETY: `leaf` points to a `LeafNode`.
91+ unsafe { LeafNode :: init ( leaf. as_mut_ptr ( ) ) } ;
92+ // SAFETY: `leaf` was just initialized.
93+ unsafe { leaf. assume_init ( ) }
9694 }
9795}
9896
@@ -121,13 +119,11 @@ impl<K, V> InternalNode<K, V> {
121119 /// such an edge.
122120 unsafe fn new < A : Allocator + Clone > ( alloc : A ) -> Box < Self , A > {
123121 let mut node = Box :: < Self , _ > :: new_uninit_in ( alloc) ;
124- // SAFETY: Untriaged.
125- unsafe {
126- // SAFETY: argument points to the `node.data` `LeafNode`
127- LeafNode :: init ( & raw mut ( * node. as_mut_ptr ( ) ) . data ) ;
128- // SAFETY: `node.data` was just initialized and `node.edges` is MaybeUninit.
129- node. assume_init ( )
130- }
122+
123+ // SAFETY: argument points to the `node.data` `LeafNode`.
124+ unsafe { LeafNode :: init ( & raw mut ( * node. as_mut_ptr ( ) ) . data ) } ;
125+ // SAFETY: `node.data` was just initialized and `node.edges` is MaybeUninit.
126+ unsafe { node. assume_init ( ) }
131127 }
132128}
133129
0 commit comments