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_actions/src/connection/action_service.rs | 4 ++-- crates/vcs_actions/src/registry/client_registry.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'crates/vcs_actions') diff --git a/crates/vcs_actions/src/connection/action_service.rs b/crates/vcs_actions/src/connection/action_service.rs index 0a49953..c302fd4 100644 --- a/crates/vcs_actions/src/connection/action_service.rs +++ b/crates/vcs_actions/src/connection/action_service.rs @@ -30,7 +30,7 @@ pub async fn server_entry(vault_path: impl Into) -> Result<(), TcpTarge // Start the server let (_shutdown_rx, future) = build_server_future(vault.clone(), action_pool.clone(), listener); - let _ = future.await?; // Start and block until shutdown + future.await?; // Start and block until shutdown Ok(()) } @@ -38,7 +38,7 @@ pub async fn server_entry(vault_path: impl Into) -> Result<(), TcpTarge async fn create_tcp_listener(cfg: &VaultConfig) -> Result { let local_bind_addr = cfg.server_config().local_bind(); let bind_port = cfg.server_config().port(); - let sock_addr = SocketAddr::new(local_bind_addr.clone(), bind_port); + let sock_addr = SocketAddr::new(*local_bind_addr, bind_port); let listener = TcpListener::bind(sock_addr).await?; Ok(listener) diff --git a/crates/vcs_actions/src/registry/client_registry.rs b/crates/vcs_actions/src/registry/client_registry.rs index 47fd7ee..5939bed 100644 --- a/crates/vcs_actions/src/registry/client_registry.rs +++ b/crates/vcs_actions/src/registry/client_registry.rs @@ -46,8 +46,8 @@ async fn on_proc_begin( if is_remote { // Build protocol message let msg = RemoteActionInvoke { - action_name: action_name, - action_args_json: action_args_json, + action_name, + action_args_json, }; // Send -- cgit