Rewrite From<> implementations for habit iterators
to be generic over all iterators over StoreIds, so they can be build directly from them.
This commit is contained in:
parent
3c1a0a51c9
commit
da0c1fa594
1 changed files with 13 additions and 0 deletions
|
@ -18,6 +18,7 @@
|
|||
//
|
||||
|
||||
use libimagstore::storeid::StoreIdIterator;
|
||||
use libimagstore::storeid::StoreIdIteratorWithStore;
|
||||
use libimagstore::storeid::StoreId;
|
||||
|
||||
use util::IsHabitCheck;
|
||||
|
@ -43,6 +44,12 @@ impl From<StoreIdIterator> for HabitTemplateStoreIdIterator {
|
|||
}
|
||||
}
|
||||
|
||||
impl<'a> From<StoreIdIteratorWithStore<'a>> for HabitTemplateStoreIdIterator {
|
||||
fn from(sii: StoreIdIteratorWithStore<'a>) -> Self {
|
||||
HabitTemplateStoreIdIterator(sii.without_store())
|
||||
}
|
||||
}
|
||||
|
||||
pub struct HabitInstanceStoreIdIterator(StoreIdIterator);
|
||||
|
||||
impl HabitInstanceStoreIdIterator {
|
||||
|
@ -70,3 +77,9 @@ impl From<StoreIdIterator> for HabitInstanceStoreIdIterator {
|
|||
}
|
||||
}
|
||||
|
||||
impl<'a> From<StoreIdIteratorWithStore<'a>> for HabitInstanceStoreIdIterator {
|
||||
fn from(sii: StoreIdIteratorWithStore<'a>) -> Self {
|
||||
HabitInstanceStoreIdIterator(sii.without_store())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue