Refactor libimagwiki to fit new store iterator interface
This commit is contained in:
parent
715753ed25
commit
40688a3c2d
1 changed files with 6 additions and 3 deletions
|
@ -108,12 +108,15 @@ impl<'a, 'b> Wiki<'a, 'b> {
|
||||||
pub struct WikiIdIterator<'a>(StoreIdIteratorWithStore<'a>, IdIsInWikiFilter<'a>);
|
pub struct WikiIdIterator<'a>(StoreIdIteratorWithStore<'a>, IdIsInWikiFilter<'a>);
|
||||||
|
|
||||||
impl<'a> Iterator for WikiIdIterator<'a> {
|
impl<'a> Iterator for WikiIdIterator<'a> {
|
||||||
type Item = StoreId;
|
type Item = Result<StoreId>;
|
||||||
|
|
||||||
fn next(&mut self) -> Option<Self::Item> {
|
fn next(&mut self) -> Option<Self::Item> {
|
||||||
while let Some(next) = self.0.next() {
|
while let Some(next) = self.0.next() {
|
||||||
if self.1.filter(&next) {
|
match next {
|
||||||
return Some(next)
|
Ok(next) => if self.1.filter(&next) {
|
||||||
|
return Some(Ok(next));
|
||||||
|
},
|
||||||
|
Err(e) => return Some(Err(e).map_err(WE::from)),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue