1
1
use crate :: { aliases:: N , pinned_storage:: PinnedStorage , MemoryPolicy , Tree , TreeVariant } ;
2
2
use core:: iter:: FusedIterator ;
3
- use orx_pinned_vec :: PinnedVec ;
3
+ use orx_iterable :: { Collection , CollectionMut , Iterable } ;
4
4
5
5
// owned
6
6
@@ -102,6 +102,9 @@ where
102
102
103
103
// ref
104
104
105
+ type PinnedVecIter < ' a , V , P > =
106
+ <<<P as PinnedStorage >:: PinnedVec < V > as Collection >:: Iterable < ' a > as Iterable >:: Iter ;
107
+
105
108
impl < ' a , V , M , P > IntoIterator for & ' a Tree < V , M , P >
106
109
where
107
110
V : TreeVariant ,
@@ -110,8 +113,7 @@ where
110
113
{
111
114
type Item = & ' a V :: Item ;
112
115
113
- type IntoIter =
114
- TreeIter < ' a , V , <<P as PinnedStorage >:: PinnedVec < V > as PinnedVec < N < V > > >:: Iter < ' a > > ;
116
+ type IntoIter = TreeIter < ' a , V , PinnedVecIter < ' a , V , P > > ;
115
117
116
118
/// Creates an iterator over references to the data of the nodes of the tree in
117
119
/// a deterministic but an arbitrary order.
@@ -203,6 +205,9 @@ where
203
205
204
206
// mut
205
207
208
+ type PinnedVecIterMut < ' a , V , P > =
209
+ <<P as PinnedStorage >:: PinnedVec < V > as CollectionMut >:: IterMut < ' a > ;
210
+
206
211
impl < ' a , V , M , P > IntoIterator for & ' a mut Tree < V , M , P >
207
212
where
208
213
V : TreeVariant ,
@@ -211,8 +216,7 @@ where
211
216
{
212
217
type Item = & ' a mut V :: Item ;
213
218
214
- type IntoIter =
215
- TreeIterMut < ' a , V , <<P as PinnedStorage >:: PinnedVec < V > as PinnedVec < N < V > > >:: IterMut < ' a > > ;
219
+ type IntoIter = TreeIterMut < ' a , V , PinnedVecIterMut < ' a , V , P > > ;
216
220
217
221
/// Creates a mutable iterator over references to the data of the nodes of the tree in
218
222
/// a deterministic but an arbitrary order.
0 commit comments