diff options
author | Matthias Beyer <mail@beyermatthias.de> | 2017-11-24 18:55:12 +0100 |
---|---|---|
committer | Matthias Beyer <mail@beyermatthias.de> | 2017-12-08 14:54:45 +0100 |
commit | dc7a315176f2faf2f46e5ff06fa75c3db74b9b36 (patch) | |
tree | 2428493fcc9d676d1c5201bf7a2716b636a18e9b /lib/domain/libimaghabit/src/iter.rs | |
parent | b181b488a2a4285cec338d0328c05cbeb1098486 (diff) |
Getter for all instances
Diffstat (limited to 'lib/domain/libimaghabit/src/iter.rs')
-rw-r--r-- | lib/domain/libimaghabit/src/iter.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/domain/libimaghabit/src/iter.rs b/lib/domain/libimaghabit/src/iter.rs index d3c96508..416cbe66 100644 --- a/lib/domain/libimaghabit/src/iter.rs +++ b/lib/domain/libimaghabit/src/iter.rs @@ -21,12 +21,14 @@ use toml::Value; use toml_query::read::TomlValueReadExt; use libimagstore::store::FileLockEntry; +use libimagstore::store::Store; use libimagstore::storeid::StoreIdIterator; use libimagstore::storeid::StoreId; use error::HabitError as HE; use error::HabitErrorKind as HEK; use error::*; +use util::IsHabitCheck; pub struct HabitTemplateStoreIdIterator(StoreIdIterator); @@ -35,7 +37,7 @@ impl Iterator for HabitTemplateStoreIdIterator { fn next(&mut self) -> Option<Self::Item> { while let Some(n) = self.0.next() { - if n.is_in_collection(&["habit", "template"]) { + if n.is_habit_template() { return Some(n) } } @@ -56,7 +58,7 @@ impl Iterator for HabitInstanceStoreIdIterator { fn next(&mut self) -> Option<Self::Item> { while let Some(n) = self.0.next() { - if n.is_in_collection(&["habit", "instance"]) { + if n.is_habit_instance() { return Some(n) } } |