summaryrefslogtreecommitdiffstats
path: root/libimagref
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2016-07-05 12:42:47 +0200
committerMatthias Beyer <mail@beyermatthias.de>2016-07-05 12:42:52 +0200
commit55c39ac94d220723df688a7a46289e3684f953e0 (patch)
treebf9bb7b822324c40f281e5c7ab0c2322aaf7fe0f /libimagref
parent1211a997754ed292d83a707662fd74bd1fa18fe8 (diff)
Fix: We cannot offer a Ref::delete(self), but a Ref::delete_by_hash()
We cannot offer the former because deleting self would always fail as the FileLockEntry is already borrowed from the store, so the store declines this. But deleting by hash works.
Diffstat (limited to 'libimagref')
-rw-r--r--libimagref/src/reference.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/libimagref/src/reference.rs b/libimagref/src/reference.rs
index 465ca105..cd3edca7 100644
--- a/libimagref/src/reference.rs
+++ b/libimagref/src/reference.rs
@@ -56,12 +56,12 @@ impl<'a> Ref<'a> {
.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.
- pub fn delete(self, store: &'a Store) -> Result<()> {
+ pub fn delete_by_hash(store: &'a Store, hash: String) -> Result<()> {
store
- .delete(self.0.get_location().clone())
+ .delete(ModuleEntryPath::new(hash).into_storeid())
.map_err(Box::new)
.map_err(|e| REK::StoreWriteError.into_error_with_cause(e))
}