From 4810f56e6a49b60923eb850d5944457650c81c75 Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Mon, 13 Oct 2025 14:27:01 +0800 Subject: Fix Clippy warnings and optimize code - Fix let_underscore_future warning by properly awaiting async functions - Make accept_import function async to match add_mapping usage - Propagate errors properly with ? operator instead of ignoring them - Replace manual Default implementation with derive attribute - Replace vec! with array literal to avoid useless_vec warning - All tests pass and code is now Clippy clean --- crates/vcs_data/src/data/sheet.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'crates/vcs_data/src') diff --git a/crates/vcs_data/src/data/sheet.rs b/crates/vcs_data/src/data/sheet.rs index a6220c9..f1cf67c 100644 --- a/crates/vcs_data/src/data/sheet.rs +++ b/crates/vcs_data/src/data/sheet.rs @@ -107,7 +107,7 @@ impl<'a> Sheet<'a> { } /// Accept an input package and insert to the sheet - pub fn accept_import( + pub async fn accept_import( &mut self, input_name: &InputName, insert_to: &SheetPathBuf, @@ -129,7 +129,8 @@ impl<'a> Sheet<'a> { // Insert to sheet for (relative_path, virtual_file_id) in input.files { - let _ = self.add_mapping(insert_to.join(relative_path), virtual_file_id); + self.add_mapping(insert_to.join(relative_path), virtual_file_id) + .await?; } Ok(()) @@ -176,8 +177,7 @@ impl<'a> Sheet<'a> { } Err(_) => { // Error checking rights, don't allow modifying the mapping - Err(std::io::Error::new( - std::io::ErrorKind::Other, + Err(std::io::Error::other( "Failed to check virtual file edit rights", )) } -- cgit