diff options
| author | Mara Bos <m-ou.se@m-ou.se> | 2020-09-09 18:38:10 +0200 |
|---|---|---|
| committer | Mara Bos <m-ou.se@m-ou.se> | 2020-09-09 18:38:10 +0200 |
| commit | 4506d26cf39dcde786d4853af133bf26799bf65d (patch) | |
| tree | afee2a458ac7d8e63e5702cb0de792a8cc4c5f82 /library/alloc/src/collections | |
| parent | b4bdc07ff5a70175dbcdff7331c557245ddb012f (diff) | |
| download | rust-4506d26cf39dcde786d4853af133bf26799bf65d.tar.gz rust-4506d26cf39dcde786d4853af133bf26799bf65d.zip | |
Remove internal and unstable MaybeUninit::UNINIT.
Looks like it is no longer necessary, as uninit_array() can be used instead in the few cases where it was needed.
Diffstat (limited to 'library/alloc/src/collections')
| -rw-r--r-- | library/alloc/src/collections/btree/node.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/library/alloc/src/collections/btree/node.rs b/library/alloc/src/collections/btree/node.rs index 1346ad19fe2..04d2b205a27 100644 --- a/library/alloc/src/collections/btree/node.rs +++ b/library/alloc/src/collections/btree/node.rs @@ -78,8 +78,8 @@ impl<K, V> LeafNode<K, V> { LeafNode { // As a general policy, we leave fields uninitialized if they can be, as this should // be both slightly faster and easier to track in Valgrind. - keys: [MaybeUninit::UNINIT; CAPACITY], - vals: [MaybeUninit::UNINIT; CAPACITY], + keys: MaybeUninit::uninit_array(), + vals: MaybeUninit::uninit_array(), parent: ptr::null(), parent_idx: MaybeUninit::uninit(), len: 0, @@ -111,7 +111,7 @@ impl<K, V> InternalNode<K, V> { /// `len` of 0), there must be one initialized and valid edge. This function does not set up /// such an edge. unsafe fn new() -> Self { - InternalNode { data: unsafe { LeafNode::new() }, edges: [MaybeUninit::UNINIT; 2 * B] } + InternalNode { data: unsafe { LeafNode::new() }, edges: MaybeUninit::uninit_array() } } } |
