summaryrefslogtreecommitdiff
path: root/lib/core/libimagstore/src/iter.rs
diff options
context:
space:
mode:
Diffstat (limited to 'lib/core/libimagstore/src/iter.rs')
-rw-r--r--lib/core/libimagstore/src/iter.rs15
1 files changed, 8 insertions, 7 deletions
diff --git a/lib/core/libimagstore/src/iter.rs b/lib/core/libimagstore/src/iter.rs
index d42c92f..460ebf0 100644
--- a/lib/core/libimagstore/src/iter.rs
+++ b/lib/core/libimagstore/src/iter.rs
@@ -34,6 +34,12 @@ macro_rules! mk_iterator {
pub struct $itername<'a>(Box<Iterator<Item = StoreId>>, &'a Store);
+ impl<'a> $itername<'a> {
+ pub fn new(inner: Box<Iterator<Item = StoreId>>, store: &'a Store) -> Self {
+ $itername(inner, store)
+ }
+ }
+
impl<'a> Iterator for $itername<'a> {
type Item = Result<$yield>;
@@ -196,18 +202,14 @@ mod compile_test {
}
fn test_compile_get() {
- use super::get::StoreIdGetIteratorExtension;
-
let store = store();
let _ = store
.entries()
.unwrap()
- .into_get_iter(&store);
+ .into_get_iter();
}
fn test_compile_get_result() {
- use super::get::StoreIdGetResultIteratorExtension;
-
fn to_result(e: StoreId) -> Result<StoreId, ()> {
Ok(e)
}
@@ -216,8 +218,7 @@ mod compile_test {
let _ = store
.entries()
.unwrap()
- .map(to_result)
- .into_get_iter(&store);
+ .into_get_iter();
}
}