@@ -9,7 +9,7 @@ use core::ops::{Index, RangeBounds};
99use core:: ptr;
1010
1111use super :: borrow:: DormantMutRef ;
12- use super :: node:: { self , marker, ForceResult :: * , Handle , NodeRef } ;
12+ use super :: node:: { self , marker, ForceResult :: * , Handle , NodeRef , Root } ;
1313use super :: search:: { self , SearchResult :: * } ;
1414use super :: unwrap_unchecked;
1515
@@ -128,7 +128,7 @@ pub(super) const MIN_LEN: usize = node::MIN_LEN_AFTER_SPLIT;
128128/// ```
129129#[ stable( feature = "rust1" , since = "1.0.0" ) ]
130130pub struct BTreeMap < K , V > {
131- root : Option < node :: Root < K , V > > ,
131+ root : Option < Root < K , V > > ,
132132 length : usize ,
133133}
134134
@@ -145,15 +145,15 @@ unsafe impl<#[may_dangle] K, #[may_dangle] V> Drop for BTreeMap<K, V> {
145145impl < K : Clone , V : Clone > Clone for BTreeMap < K , V > {
146146 fn clone ( & self ) -> BTreeMap < K , V > {
147147 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 > ,
149149 ) -> BTreeMap < K , V >
150150 where
151151 K : ' a ,
152152 V : ' a ,
153153 {
154154 match node. force ( ) {
155155 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 } ;
157157
158158 {
159159 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> {
198198 ( root, length)
199199 } ;
200200
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 ) ) ;
202202 out_tree. length += 1 + sublength;
203203 }
204204 }
@@ -1558,7 +1558,7 @@ pub(super) struct DrainFilterInner<'a, K: 'a, V: 'a> {
15581558 length : & ' a mut usize ,
15591559 /// Burried reference to the root field in the borrowed map.
15601560 /// 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 > > > ,
15621562 /// Contains a leaf edge preceding the next element to be returned, or the last leaf edge.
15631563 /// Empty if the map has no root, if iteration went beyond the last leaf edge,
15641564 /// or if a panic occurred in the predicate.
@@ -2160,8 +2160,8 @@ impl<K, V> BTreeMap<K, V> {
21602160
21612161 /// If the root node is the empty (non-allocated) root node, allocate our
21622162 /// 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 )
21652165 }
21662166}
21672167
0 commit comments