Skip to content

Commit 2d0b092

Browse files
authored
Merge pull request #154 from orxfun/Use-of-Collection-constrained-PinnedVecs
Use of Collection constrained PinnedVecs
2 parents 2afc739 + bbf0ce1 commit 2d0b092

File tree

2 files changed

+14
-10
lines changed

2 files changed

+14
-10
lines changed

Cargo.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "orx-tree"
3-
version = "1.0.2"
3+
version = "1.1.0"
44
edition = "2021"
55
authors = ["orxfun <[email protected]>"]
66
description = "A beautiful tree 🌳 with convenient and efficient growth, mutation and traversal features."
@@ -10,16 +10,16 @@ keywords = ["tree", "data-structures", "traversal", "traverse", "binarytree"]
1010
categories = ["data-structures", "algorithms", "rust-patterns", "no-std"]
1111

1212
[dependencies]
13-
orx-pinned-vec = "3.11"
14-
orx-split-vec = "3.11"
15-
orx-selfref-col = "2.4"
13+
orx-pinned-vec = "3.12"
14+
orx-split-vec = "3.12"
15+
orx-selfref-col = "2.5"
1616
orx-self-or = "1.0"
1717
orx-iterable = "1.1.1"
1818
serde = { version = "1.0.217", optional = true, default-features = false }
1919

2020
[dev-dependencies]
2121
test-case = { version = "3.3.1", default-features = false }
22-
serde_json = { version = "1.0.137", default-features = false, features = [
22+
serde_json = { version = "1.0.138", default-features = false, features = [
2323
"std",
2424
] }
2525

src/common_traits/into_iterator.rs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use crate::{aliases::N, pinned_storage::PinnedStorage, MemoryPolicy, Tree, TreeVariant};
22
use core::iter::FusedIterator;
3-
use orx_pinned_vec::PinnedVec;
3+
use orx_iterable::{Collection, CollectionMut, Iterable};
44

55
// owned
66

@@ -102,6 +102,9 @@ where
102102

103103
// ref
104104

105+
type PinnedVecIter<'a, V, P> =
106+
<<<P as PinnedStorage>::PinnedVec<V> as Collection>::Iterable<'a> as Iterable>::Iter;
107+
105108
impl<'a, V, M, P> IntoIterator for &'a Tree<V, M, P>
106109
where
107110
V: TreeVariant,
@@ -110,8 +113,7 @@ where
110113
{
111114
type Item = &'a V::Item;
112115

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>>;
115117

116118
/// Creates an iterator over references to the data of the nodes of the tree in
117119
/// a deterministic but an arbitrary order.
@@ -203,6 +205,9 @@ where
203205

204206
// mut
205207

208+
type PinnedVecIterMut<'a, V, P> =
209+
<<P as PinnedStorage>::PinnedVec<V> as CollectionMut>::IterMut<'a>;
210+
206211
impl<'a, V, M, P> IntoIterator for &'a mut Tree<V, M, P>
207212
where
208213
V: TreeVariant,
@@ -211,8 +216,7 @@ where
211216
{
212217
type Item = &'a mut V::Item;
213218

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>>;
216220

217221
/// Creates a mutable iterator over references to the data of the nodes of the tree in
218222
/// a deterministic but an arbitrary order.

0 commit comments

Comments
 (0)