Remove Deref for StoreId but provide basic functions within the type
This commit is contained in:
parent
69b3f6bf87
commit
1d165f6fc2
1 changed files with 13 additions and 9 deletions
|
@ -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 {
|
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 {
|
impl From<PathBuf> for StoreId {
|
||||||
|
|
||||||
fn from(pb: PathBuf) -> StoreId {
|
fn from(pb: PathBuf) -> StoreId {
|
||||||
|
|
Loading…
Reference in a new issue