Fix use of store ids when passing to FileAbstraction::*
This commit is contained in:
parent
111cb4f29a
commit
3c1be0fbe9
1 changed files with 8 additions and 6 deletions
|
@ -682,15 +682,17 @@ impl Store {
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
let hsmap = self.entries.write();
|
let hsmap = match self.entries.write() {
|
||||||
if hsmap.is_err() {
|
Err(_) => return Err(SE::new(SEK::LockPoisoned, None)),
|
||||||
return Err(SE::new(SEK::LockPoisoned, None))
|
Ok(m) => m,
|
||||||
}
|
};
|
||||||
let hsmap = hsmap.unwrap();
|
|
||||||
if hsmap.contains_key(&old_id) {
|
if hsmap.contains_key(&old_id) {
|
||||||
return Err(SE::new(SEK::EntryAlreadyBorrowed, None));
|
return Err(SE::new(SEK::EntryAlreadyBorrowed, None));
|
||||||
} else {
|
} else {
|
||||||
match FileAbstraction::rename(&old_id.clone(), &new_id) {
|
let old_id_pb = old_id.clone().into();
|
||||||
|
let new_id_pb = new_id.clone().into();
|
||||||
|
match FileAbstraction::rename(&old_id_pb, &new_id_pb) {
|
||||||
Err(e) => return Err(SEK::EntryRenameError.into_error_with_cause(Box::new(e))),
|
Err(e) => return Err(SEK::EntryRenameError.into_error_with_cause(Box::new(e))),
|
||||||
Ok(_) => {
|
Ok(_) => {
|
||||||
debug!("Rename worked");
|
debug!("Rename worked");
|
||||||
|
|
Loading…
Reference in a new issue