diff options
author | Matthias Beyer <mail@beyermatthias.de> | 2018-04-30 17:28:54 +0200 |
---|---|---|
committer | Matthias Beyer <mail@beyermatthias.de> | 2018-05-01 17:44:01 +0200 |
commit | 40688a3c2da8054f144b915f7676fba0e802c30c (patch) | |
tree | 2f2321fc4902e99e02a724992d14381c10448331 /lib | |
parent | 715753ed25b319e7cc88695d743659c38a40837b (diff) |
Refactor libimagwiki to fit new store iterator interface
Diffstat (limited to 'lib')
-rw-r--r-- | lib/domain/libimagwiki/src/wiki.rs | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/domain/libimagwiki/src/wiki.rs b/lib/domain/libimagwiki/src/wiki.rs index 50ef61cd..0612bec8 100644 --- a/lib/domain/libimagwiki/src/wiki.rs +++ b/lib/domain/libimagwiki/src/wiki.rs @@ -108,12 +108,15 @@ impl<'a, 'b> Wiki<'a, 'b> { pub struct WikiIdIterator<'a>(StoreIdIteratorWithStore<'a>, IdIsInWikiFilter<'a>); impl<'a> Iterator for WikiIdIterator<'a> { - type Item = StoreId; + type Item = Result<StoreId>; fn next(&mut self) -> Option<Self::Item> { while let Some(next) = self.0.next() { - if self.1.filter(&next) { - return Some(next) + match next { + Ok(next) => if self.1.filter(&next) { + return Some(Ok(next)); + }, + Err(e) => return Some(Err(e).map_err(WE::from)), } } |