Add another small helper
This commit is contained in:
parent
95b7da1ed2
commit
31fa07d43a
1 changed files with 10 additions and 0 deletions
|
@ -24,6 +24,8 @@ pub trait IsInDiary {
|
||||||
|
|
||||||
fn is_in_diary(&self, name: &str) -> bool;
|
fn is_in_diary(&self, name: &str) -> bool;
|
||||||
|
|
||||||
|
fn is_a_diary_entry(&self) -> bool;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl IsInDiary for Entry {
|
impl IsInDiary for Entry {
|
||||||
|
@ -32,6 +34,10 @@ impl IsInDiary for Entry {
|
||||||
self.get_location().clone().is_in_diary(name)
|
self.get_location().clone().is_in_diary(name)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn is_a_diary_entry(&self) -> bool {
|
||||||
|
self.get_location().clone().is_a_diary_entry()
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl IsInDiary for StoreId {
|
impl IsInDiary for StoreId {
|
||||||
|
@ -40,5 +46,9 @@ impl IsInDiary for StoreId {
|
||||||
self.local().starts_with(format!("diary/{}", name))
|
self.local().starts_with(format!("diary/{}", name))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn is_a_diary_entry(&self) -> bool {
|
||||||
|
self.local().starts_with("diary")
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue