@@ -9,7 +9,7 @@ use core::ops::{Index, RangeBounds};
9
9
use core:: ptr;
10
10
11
11
use super :: borrow:: DormantMutRef ;
12
- use super :: node:: { self , marker, ForceResult :: * , Handle , NodeRef } ;
12
+ use super :: node:: { self , marker, ForceResult :: * , Handle , NodeRef , Root } ;
13
13
use super :: search:: { self , SearchResult :: * } ;
14
14
use super :: unwrap_unchecked;
15
15
@@ -128,7 +128,7 @@ pub(super) const MIN_LEN: usize = node::MIN_LEN_AFTER_SPLIT;
128
128
/// ```
129
129
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
130
130
pub struct BTreeMap < K , V > {
131
- root : Option < node :: Root < K , V > > ,
131
+ root : Option < Root < K , V > > ,
132
132
length : usize ,
133
133
}
134
134
@@ -145,15 +145,15 @@ unsafe impl<#[may_dangle] K, #[may_dangle] V> Drop for BTreeMap<K, V> {
145
145
impl < K : Clone , V : Clone > Clone for BTreeMap < K , V > {
146
146
fn clone ( & self ) -> BTreeMap < K , V > {
147
147
fn clone_subtree < ' a , K : Clone , V : Clone > (
148
- node : node :: NodeRef < marker:: Immut < ' a > , K , V , marker:: LeafOrInternal > ,
148
+ node : NodeRef < marker:: Immut < ' a > , K , V , marker:: LeafOrInternal > ,
149
149
) -> BTreeMap < K , V >
150
150
where
151
151
K : ' a ,
152
152
V : ' a ,
153
153
{
154
154
match node. force ( ) {
155
155
Leaf ( leaf) => {
156
- let mut out_tree = BTreeMap { root : Some ( node :: Root :: new_leaf ( ) ) , length : 0 } ;
156
+ let mut out_tree = BTreeMap { root : Some ( Root :: new ( ) ) , length : 0 } ;
157
157
158
158
{
159
159
let root = out_tree. root . as_mut ( ) . unwrap ( ) ; // unwrap succeeds because we just wrapped
@@ -198,7 +198,7 @@ impl<K: Clone, V: Clone> Clone for BTreeMap<K, V> {
198
198
( root, length)
199
199
} ;
200
200
201
- out_node. push ( k, v, subroot. unwrap_or_else ( node :: Root :: new_leaf ) ) ;
201
+ out_node. push ( k, v, subroot. unwrap_or_else ( Root :: new ) ) ;
202
202
out_tree. length += 1 + sublength;
203
203
}
204
204
}
@@ -1558,7 +1558,7 @@ pub(super) struct DrainFilterInner<'a, K: 'a, V: 'a> {
1558
1558
length : & ' a mut usize ,
1559
1559
/// Burried reference to the root field in the borrowed map.
1560
1560
/// Wrapped in `Option` to allow drop handler to `take` it.
1561
- dormant_root : Option < DormantMutRef < ' a , node :: Root < K , V > > > ,
1561
+ dormant_root : Option < DormantMutRef < ' a , Root < K , V > > > ,
1562
1562
/// Contains a leaf edge preceding the next element to be returned, or the last leaf edge.
1563
1563
/// Empty if the map has no root, if iteration went beyond the last leaf edge,
1564
1564
/// or if a panic occurred in the predicate.
@@ -2160,8 +2160,8 @@ impl<K, V> BTreeMap<K, V> {
2160
2160
2161
2161
/// If the root node is the empty (non-allocated) root node, allocate our
2162
2162
/// own node. Is an associated function to avoid borrowing the entire BTreeMap.
2163
- fn ensure_is_owned ( root : & mut Option < node :: Root < K , V > > ) -> & mut node :: Root < K , V > {
2164
- root. get_or_insert_with ( node :: Root :: new_leaf )
2163
+ fn ensure_is_owned ( root : & mut Option < Root < K , V > > ) -> & mut Root < K , V > {
2164
+ root. get_or_insert_with ( Root :: new )
2165
2165
}
2166
2166
}
2167
2167
0 commit comments