diff --git a/libimagstore/src/storeid.rs b/libimagstore/src/storeid.rs index 94eb0c4a..8b2d9d60 100644 --- a/libimagstore/src/storeid.rs +++ b/libimagstore/src/storeid.rs @@ -21,11 +21,15 @@ pub struct StoreId { impl StoreId { pub fn new(base: Option, id: PathBuf) -> Result { + StoreId::new_baseless(id).map(|mut sid| { sid.base = base; sid }) + } + + pub fn new_baseless(id: PathBuf) -> Result { if id.is_absolute() { Err(SEK::StoreIdLocalPartAbsoluteError.into_error()) } else { Ok(StoreId { - base: base, + base: None, id: id }) }