diff options
author | Matthias Beyer <mail@beyermatthias.de> | 2018-01-31 18:34:37 +0100 |
---|---|---|
committer | Matthias Beyer <mail@beyermatthias.de> | 2018-02-01 16:46:38 +0100 |
commit | da0c1fa5948a1174b4d01494531e05abba631166 (patch) | |
tree | 79711c7233231d28bbdcc8c979a217bfe1cfe966 /lib/domain/libimaghabit/src/iter.rs | |
parent | 3c1a0a51c90a130d8cf28cc3d0d8a674548f7ea8 (diff) |
Rewrite From<> implementations for habit iterators
to be generic over all iterators over StoreIds, so they can be build
directly from them.
Diffstat (limited to 'lib/domain/libimaghabit/src/iter.rs')
-rw-r--r-- | lib/domain/libimaghabit/src/iter.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/domain/libimaghabit/src/iter.rs b/lib/domain/libimaghabit/src/iter.rs index 9d5d740f..71f7220b 100644 --- a/lib/domain/libimaghabit/src/iter.rs +++ b/lib/domain/libimaghabit/src/iter.rs @@ -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()) + } +} + |