From ffdc23d102faab74838a36a8044c6f11b289d760 Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Sun, 12 Oct 2025 18:16:36 +0800 Subject: refactor: Update action macros and error types - Enhance action_gen macro functionality - Add new error variants for TCP connection --- crates/utils/tcp_connection/src/error.rs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'crates/utils/tcp_connection') diff --git a/crates/utils/tcp_connection/src/error.rs b/crates/utils/tcp_connection/src/error.rs index 691e5ee..28e33d3 100644 --- a/crates/utils/tcp_connection/src/error.rs +++ b/crates/utils/tcp_connection/src/error.rs @@ -41,6 +41,9 @@ pub enum TcpTargetError { #[error("Not remote machine: {0}")] NotRemote(String), + + #[error("Not found: {0}")] + NotFound(String), } impl From for TcpTargetError { -- cgit 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 --- .../tcp_connection/tcp_connection_test/src/test_msgpack.rs | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'crates/utils/tcp_connection') diff --git a/crates/utils/tcp_connection/tcp_connection_test/src/test_msgpack.rs b/crates/utils/tcp_connection/tcp_connection_test/src/test_msgpack.rs index 7a7dc1f..4c9c870 100644 --- a/crates/utils/tcp_connection/tcp_connection_test/src/test_msgpack.rs +++ b/crates/utils/tcp_connection/tcp_connection_test/src/test_msgpack.rs @@ -9,21 +9,12 @@ use crate::test_utils::{ target_configure::ServerTargetConfig, }; -#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[derive(Debug, PartialEq, Serialize, Deserialize, Default)] struct TestData { id: u32, name: String, } -impl Default for TestData { - fn default() -> Self { - Self { - id: 0, - name: String::new(), - } - } -} - pub(crate) struct MsgPackClientHandle; impl ClientHandle for MsgPackClientHandle { -- cgit