Add StoreId::new()

This commit is contained in:
Matthias Beyer 2016-08-07 16:54:36 +02:00
parent 8dff5685fd
commit fe73a53d44
1 changed files with 4 additions and 0 deletions

View File

@ -21,6 +21,10 @@ pub struct StoreId {
impl StoreId {
pub fn new(base: Option<PathBuf>, id: PathBuf) -> StoreId {
StoreId { base: base, id: id }
}
pub fn storified(self, store: &Store) -> StoreId {
if self.starts_with(store.path()) {
debug!("Not storifying {:?}, because it is already.", self);