Merge pull request #669 from TheNeikos/fix-code_dup

Remove duplication
This commit is contained in:
Matthias Beyer 2016-08-25 10:15:13 +02:00 committed by GitHub
commit ab4a75421d
1 changed files with 2 additions and 12 deletions

View File

@ -687,21 +687,11 @@ impl Store {
} else {
match FileAbstraction::rename(&old_id.clone(), &new_id) {
Err(e) => return Err(SEK::EntryRenameError.into_error_with_cause(Box::new(e))),
_ => {
Ok(_) => {
debug!("Rename worked");
},
}
if hsmap.contains_key(&old_id) {
return Err(SE::new(SEK::EntryAlreadyBorrowed, None));
} else {
match FileAbstraction::rename(&old_id, &new_id) {
Err(e) => return Err(SEK::EntryRenameError.into_error_with_cause(Box::new(e))),
_ => {
debug!("Rename worked");
},
}
}
}
}
}