diff options
author | 林炳权 <695601626@qq.com> | 2024-10-16 00:10:07 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-15 21:40:07 +0530 |
commit | 533a9b108677f1560fe55882771a0be2bb0b0fd2 (patch) | |
tree | 39f8d1e734f40a4cdafb0e6b582ceeea26d491ea /cli/util/fs.rs | |
parent | e4b52f5a7684cfb6754f2531e51f833a64d97d7b (diff) |
chore: upgrade to rust 1.81.0 (#26261)
Diffstat (limited to 'cli/util/fs.rs')
-rw-r--r-- | cli/util/fs.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/cli/util/fs.rs b/cli/util/fs.rs index 2ad3affc8..2c34f486a 100644 --- a/cli/util/fs.rs +++ b/cli/util/fs.rs @@ -160,11 +160,11 @@ fn atomic_write_file( data: &[u8], ) -> std::io::Result<()> { fs.write_file(temp_file_path, data)?; - fs.rename_file(temp_file_path, file_path).map_err(|err| { - // clean up the created temp file on error - let _ = fs.remove_file(temp_file_path); - err - }) + fs.rename_file(temp_file_path, file_path) + .inspect_err(|_err| { + // clean up the created temp file on error + let _ = fs.remove_file(temp_file_path); + }) } let temp_file_path = get_atomic_file_path(file_path); |