Merge pull request #1094 from matthiasbeyer/libimagdiary/is_in_diary

Base IsInDiary::is_in_diary() on StoreId::is_in_collection()
This commit is contained in:
Matthias Beyer 2017-09-20 22:00:41 +02:00 committed by GitHub
commit 87ad85ab3d

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"])
} }
} }