use libimagstore::store::Entry;
use libimagstore::storeid::StoreId;

pub trait IsInDiary {

    fn is_in_diary(&self, name: &str) -> bool;

}

impl IsInDiary for Entry {

    fn is_in_diary(&self, name: &str) -> bool {
        self.get_location().clone().is_in_diary(name)
    }

}

impl IsInDiary for StoreId {

    fn is_in_diary(&self, name: &str) -> bool {
        self.is_in_collection(&["diary", name])
    }

}


use libimagstore::store::Entry;
use libimagstore::storeid::StoreId;

pub trait IsInDiary {

    fn is_in_diary(&self, name: &str) -> bool;

}

impl IsInDiary for Entry {

    fn is_in_diary(&self, name: &str) -> bool {
        self.get_location().clone().is_in_diary(name)
    }

}

impl IsInDiary for StoreId {

    fn is_in_diary(&self, name: &str) -> bool {
        self.to_str().map(|s| s.contains(name)).unwrap_or(false)
    }

}


--- 
+++ 
@@ -18,7 +18,7 @@
 impl IsInDiary for StoreId {
 
     fn is_in_diary(&self, name: &str) -> bool {
-        self.to_str().map(|s| s.contains(name)).unwrap_or(false)
+        self.is_in_collection(&["diary", name])
     }
 
 }
Reimplement IsInDiary for StoreId with StoreId::is_in_collection()
