Merge pull request #500 from matthiasbeyer/libimagref/delete-fix
Fix: We cannot offer a Ref::delete(self), but a Ref::delete_by_hash()
This commit is contained in:
commit
64ddb501e2
1 changed files with 3 additions and 3 deletions
|
@ -56,12 +56,12 @@ impl<'a> Ref<'a> {
|
||||||
.map_err(|e| REK::StoreReadError.into_error_with_cause(e))
|
.map_err(|e| REK::StoreReadError.into_error_with_cause(e))
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Delete this ref
|
/// Delete a ref by hash
|
||||||
///
|
///
|
||||||
/// If the returned Result contains an error, the ref might not be deleted.
|
/// If the returned Result contains an error, the ref might not be deleted.
|
||||||
pub fn delete(self, store: &'a Store) -> Result<()> {
|
pub fn delete_by_hash(store: &'a Store, hash: String) -> Result<()> {
|
||||||
store
|
store
|
||||||
.delete(self.0.get_location().clone())
|
.delete(ModuleEntryPath::new(hash).into_storeid())
|
||||||
.map_err(Box::new)
|
.map_err(Box::new)
|
||||||
.map_err(|e| REK::StoreWriteError.into_error_with_cause(e))
|
.map_err(|e| REK::StoreWriteError.into_error_with_cause(e))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue