From 40688a3c2da8054f144b915f7676fba0e802c30c Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Mon, 30 Apr 2018 17:28:54 +0200 Subject: [PATCH] Refactor libimagwiki to fit new store iterator interface --- lib/domain/libimagwiki/src/wiki.rs | 9 ++++++--- 1 file 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; fn next(&mut self) -> Option { 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)), } }