diff options
author | Lukasz Woznicki <75632179+makr11st@users.noreply.github.com> | 2021-09-28 10:08:02 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-28 10:08:02 +0100 |
commit | db6d0f7864e2e2c0b08f73855afd5a5d8b1cb27e (patch) | |
tree | a91fc410017eb4e5db262111fdb21e8986f862b8 | |
parent | 175a7173b53f862ae623e7a55b223427e96e2c9f (diff) |
Add await on file remove in async_write_atomic (#455)
Signed-off-by: Lukasz Woznicki <lukasz.woznicki@softwareag.com>
-rw-r--r-- | common/tedge_utils/src/fs.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/common/tedge_utils/src/fs.rs b/common/tedge_utils/src/fs.rs index f84b1dc3..197c6b8a 100644 --- a/common/tedge_utils/src/fs.rs +++ b/common/tedge_utils/src/fs.rs @@ -39,12 +39,12 @@ pub async fn atomically_write_file_async( .await?; if let Err(err) = file.write_all(content).await { - let _ = tokio_fs::remove_file(tempfile); + let () = tokio_fs::remove_file(tempfile).await?; return Err(err); } if let Err(err) = tokio_fs::rename(tempfile.as_ref(), dest).await { - let _ = tokio_fs::remove_file(tempfile); + let () = tokio_fs::remove_file(tempfile).await?; return Err(err); } |