Remove Deref for StoreId but provide basic functions within the type

This commit is contained in:
Matthias Beyer 2016-08-07 16:48:40 +02:00
parent 69b3f6bf87
commit 1d165f6fc2

View file

@ -35,6 +35,19 @@ impl StoreId {
}
}
pub fn exists(&self) -> bool {
let pb : PathBuf = self.clone().into();
pb.exists()
}
pub fn is_file(&self) -> bool {
true
}
pub fn is_dir(&self) -> bool {
false
}
}
impl Into<PathBuf> for StoreId {
@ -58,15 +71,6 @@ impl Display for StoreId {
}
impl Deref for StoreId {
type Target = PathBuf;
fn deref(&self) -> &PathBuf {
&self.0
}
}
impl From<PathBuf> for StoreId {
fn from(pb: PathBuf) -> StoreId {