diff options
| author | 魏曹先生 <1992414357@qq.com> | 2025-10-13 14:27:01 +0800 |
|---|---|---|
| committer | 魏曹先生 <1992414357@qq.com> | 2025-10-13 14:27:01 +0800 |
| commit | 4810f56e6a49b60923eb850d5944457650c81c75 (patch) | |
| tree | ef02095c73635b5ace574c26dfcb999017e34897 /crates/system_action/src/action.rs | |
| parent | acf0804b5f9bdc2796d847919a8ae20103be600a (diff) | |
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
Diffstat (limited to 'crates/system_action/src/action.rs')
| -rw-r--r-- | crates/system_action/src/action.rs | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/crates/system_action/src/action.rs b/crates/system_action/src/action.rs index 3ae5711..8a6180a 100644 --- a/crates/system_action/src/action.rs +++ b/crates/system_action/src/action.rs @@ -41,16 +41,18 @@ pub struct ActionContext { impl ActionContext { /// Generate local context pub fn local() -> Self { - let mut ctx = ActionContext::default(); - ctx.local = true; - ctx + ActionContext { + local: true, + ..Default::default() + } } /// Generate remote context pub fn remote() -> Self { - let mut ctx = ActionContext::default(); - ctx.local = false; - ctx + ActionContext { + local: false, + ..Default::default() + } } /// Build connection instance from TcpStream |
