Skip to content

Commit

Permalink
Clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
tustvold committed Sep 7, 2023
1 parent cda5141 commit c7b5e59
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions object_store/src/local.rs
Original file line number Diff line number Diff line change
Expand Up @@ -877,19 +877,14 @@ impl AsyncWrite for LocalUpload {
impl Drop for LocalUpload {
fn drop(&mut self) {
match self.inner_state {
LocalUploadState::Complete => return,
LocalUploadState::Complete => (),
_ => {
self.inner_state = LocalUploadState::Complete;
let path = staged_upload_path(&self.dest, &self.multipart_id);
// Try to cleanup intermediate file
// Try to cleanup intermediate file ignoring any error
match tokio::runtime::Handle::try_current() {
Ok(runtime) => {
let _ =
runtime.spawn_blocking(move || std::fs::remove_file(&path));
}
Err(_) => {
let _ = std::fs::remove_file(&path);
}
Ok(r) => drop(r.spawn_blocking(move || std::fs::remove_file(path))),
Err(_) => drop(std::fs::remove_file(path)),
};
}
}
Expand Down

0 comments on commit c7b5e59

Please sign in to comment.