2016-04-22 13:48:59 +00:00
|
|
|
use libimagstore::store::Entry;
|
2016-08-25 18:00:17 +00:00
|
|
|
use libimagstore::storeid::StoreId;
|
2016-04-22 13:48:59 +00:00
|
|
|
|
|
|
|
pub trait IsInDiary {
|
|
|
|
|
|
|
|
fn is_in_diary(&self, name: &str) -> bool;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
impl IsInDiary for Entry {
|
|
|
|
|
|
|
|
fn is_in_diary(&self, name: &str) -> bool {
|
2016-08-25 18:00:17 +00:00
|
|
|
self.get_location().clone().is_in_diary(name)
|
2016-04-22 13:48:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2016-08-25 18:00:17 +00:00
|
|
|
impl IsInDiary for StoreId {
|
2016-04-22 13:48:59 +00:00
|
|
|
|
|
|
|
fn is_in_diary(&self, name: &str) -> bool {
|
|
|
|
self.to_str().map(|s| s.contains(name)).unwrap_or(false)
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|