From e2e29c3934e40cfd4fde6f1b5e7517810c3bf1cd Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Thu, 25 Sep 2025 14:23:55 +0800 Subject: Fixed by Clippy --- crates/vcs/src/workspace/vault/virtual_file.rs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'crates/vcs/src/workspace/vault/virtual_file.rs') diff --git a/crates/vcs/src/workspace/vault/virtual_file.rs b/crates/vcs/src/workspace/vault/virtual_file.rs index 6e8c28d..95f3d8c 100644 --- a/crates/vcs/src/workspace/vault/virtual_file.rs +++ b/crates/vcs/src/workspace/vault/virtual_file.rs @@ -236,11 +236,10 @@ impl Vault { VirtualFileMeta::write_to(&meta, self.virtual_file_meta_path(&new_id)).await?; // Move temp file to virtual file directory - if let Some(parent) = move_path.parent() { - if !parent.exists() { + if let Some(parent) = move_path.parent() + && !parent.exists() { fs::create_dir_all(parent).await?; } - } fs::rename(receive_path, move_path).await?; Ok(new_id) @@ -251,7 +250,7 @@ impl Vault { fs::remove_file(receive_path).await?; } - Err(Error::new(ErrorKind::Other, e)) + Err(Error::other(e)) } } } @@ -312,7 +311,7 @@ impl Vault { VirtualFileMeta::write_to(&meta, self.virtual_file_meta_path(virtual_file_id)) .await?; - return Ok(()); + Ok(()) } Err(e) => { // Read failed, remove temp file. @@ -320,7 +319,7 @@ impl Vault { fs::remove_file(receive_path).await?; } - return Err(Error::new(ErrorKind::Other, e)); + Err(Error::other(e)) } } } -- cgit