Base IsInDiary::is_in_diary() on StoreId::is_in_collection(), which is tested

This commit is contained in:
Matthias Beyer 2017-09-20 18:48:55 +02:00
parent 4b906f27b1
commit da4d670cbc

View file

@ -43,11 +43,11 @@ impl IsInDiary for Entry {
impl IsInDiary for StoreId { impl IsInDiary for StoreId {
fn is_in_diary(&self, name: &str) -> bool { fn is_in_diary(&self, name: &str) -> bool {
self.local().starts_with(format!("diary/{}", name)) self.is_in_collection(&["diary", name])
} }
fn is_a_diary_entry(&self) -> bool { fn is_a_diary_entry(&self) -> bool {
self.local().starts_with("diary") self.is_in_collection(&["diary"])
} }
} }