impl Ref::delete()
This commit is contained in:
parent
31f32a4e59
commit
38557e9a9b
1 changed files with 10 additions and 0 deletions
|
@ -38,6 +38,16 @@ impl<'a> Ref<'a> {
|
|||
}
|
||||
}
|
||||
|
||||
/// Delete this ref
|
||||
///
|
||||
/// If the returned Result contains an error, the ref might not be deleted.
|
||||
pub fn delete(self, store: &'a Store) -> Result<()> {
|
||||
store
|
||||
.delete(self.0.get_location().clone())
|
||||
.map_err(Box::new)
|
||||
.map_err(|e| REK::StoreWriteError.into_error_with_cause(e))
|
||||
}
|
||||
|
||||
fn read_reference(fle: &FileLockEntry<'a>) -> Result<PathBuf> {
|
||||
match fle.get_header().read("ref.reference") {
|
||||
Ok(Some(Value::String(s))) => Ok(PathBuf::from(s)),
|
||||
|
|
Loading…
Reference in a new issue