Replace unwrap() with try!()
This commit is contained in:
parent
bd085b0ead
commit
84e33c07e6
1 changed files with 2 additions and 5 deletions
|
@ -10,11 +10,8 @@ pub fn delete(rt: &Runtime) {
|
|||
.map(|sub| {
|
||||
sub.value_of("id")
|
||||
.map(|id| {
|
||||
let path = build_entry_path(rt.store(), id);
|
||||
if path.is_err() {
|
||||
trace_error_exit(&path.unwrap_err(), 1);
|
||||
}
|
||||
let path = path.unwrap();
|
||||
let path = try!(build_entry_path(rt.store(), id)
|
||||
.map_err(|e| trace_error_exit(&e, 1)));
|
||||
debug!("Deleting file at {:?}", id);
|
||||
|
||||
rt.store()
|
||||
|
|
Loading…
Reference in a new issue