Impl Deref<PathBuf> for StoreId

This commit is contained in:
Matthias Beyer 2016-05-03 14:45:33 +02:00
parent 4d4acf9168
commit b4db587a10

View file

@ -1,6 +1,7 @@
use std::path::PathBuf; use std::path::PathBuf;
use std::path::Path; use std::path::Path;
use std::borrow::Borrow; use std::borrow::Borrow;
use std::ops::Deref;
use glob::Paths; use glob::Paths;
use semver::Version; use semver::Version;
@ -24,6 +25,15 @@ impl Into<PathBuf> 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 {