Skip to content

Commit

Permalink
Refactor simple matches to if let
Browse files Browse the repository at this point in the history
  • Loading branch information
tophatsteve committed Nov 6, 2018
1 parent d74f0a5 commit ec29764
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/event_handlers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ impl PathEventHandler for CreatedEvent {
}
let blob_name = file_system.get_blob_name(path);
let file_content = file_system.get_file_contents(path);
storage.upload(&blob_name, file_content).unwrap();
if let Err(e) = storage.upload(&blob_name, file_content) {
trace!("Error uploading - {}", e);
}
}
}

Expand All @@ -75,13 +77,12 @@ impl PathEventHandler for RemovedEvent {
Err(storage::StorageError::PathNotFound) => {
let blobs_to_delete = storage.list_folder_blobs(&blob_name).unwrap();
for blob in blobs_to_delete {
match storage.delete(&file_system.encode_file_name(&blob_name)) {
Err(e) => trace!("{}", e),
Ok(_) => (),
if let Err(e) = storage.delete(&file_system.encode_file_name(&blob_name)) {
trace!("Error deleting folder content - {}", e);
}
}
}
Err(e) => trace!("{}", e),
Err(e) => trace!("Error deleting - {}", e),
Ok(_) => (),
};
}
Expand Down

0 comments on commit ec29764

Please sign in to comment.