diff options
| author | 魏曹先生 <1992414357@qq.com> | 2026-06-18 00:50:06 +0800 |
|---|---|---|
| committer | 魏曹先生 <1992414357@qq.com> | 2026-06-18 00:50:06 +0800 |
| commit | d2e4cb85af2c6101cd435c10cfd3d4084cd83e76 (patch) | |
| tree | 4458b402f79d9f0914f76c7e39d9521c9a5a9cd0 /rola-bucket/src | |
| parent | c796e3f93183fc1fdbd4aa68976fceb339aff8d8 (diff) | |
refactor: use `io::Error::other` and simplify closures
Diffstat (limited to 'rola-bucket/src')
| -rw-r--r-- | rola-bucket/src/protocol.rs | 2 | ||||
| -rw-r--r-- | rola-bucket/src/protocol/local_fs.rs | 8 |
2 files changed, 6 insertions, 4 deletions
diff --git a/rola-bucket/src/protocol.rs b/rola-bucket/src/protocol.rs index b4d60a8..6d1074a 100644 --- a/rola-bucket/src/protocol.rs +++ b/rola-bucket/src/protocol.rs @@ -1,3 +1,5 @@ +#![allow(clippy::manual_async_fn)] + use std::path::Path; mod error; diff --git a/rola-bucket/src/protocol/local_fs.rs b/rola-bucket/src/protocol/local_fs.rs index 1f287f2..b3885a7 100644 --- a/rola-bucket/src/protocol/local_fs.rs +++ b/rola-bucket/src/protocol/local_fs.rs @@ -38,7 +38,7 @@ impl BucketTransferProtocol for LocalFileSystemProtocol { let abs_send_path = req.absolute_file_path_to_upload; let abs_receive_path = bucket_root.join(req.relative_file_path_to_receive); copy_with_temp_rename(abs_send_path, abs_receive_path) - .map_err(|e| BucketTransferProtocolError::IoError(e))?; + .map_err(BucketTransferProtocolError::IoError)?; Ok(()) } @@ -54,7 +54,7 @@ impl BucketTransferProtocol for LocalFileSystemProtocol { let abs_send_path = bucket_root.join(req.relative_file_path_to_transfer); let abs_receive_path = req.absolute_file_path_to_download; copy_with_temp_rename(abs_send_path, abs_receive_path) - .map_err(|e| BucketTransferProtocolError::IoError(e))?; + .map_err(BucketTransferProtocolError::IoError)?; Ok(()) } @@ -70,7 +70,7 @@ impl BucketTransferProtocol for LocalFileSystemProtocol { let abs_send_path = req.absolute_file_path_to_transfer; let abs_receive_path = client_root.join(req.relative_file_path_to_download); copy_with_temp_rename(abs_send_path, abs_receive_path) - .map_err(|e| BucketTransferProtocolError::IoError(e))?; + .map_err(BucketTransferProtocolError::IoError)?; Ok(()) } @@ -86,7 +86,7 @@ impl BucketTransferProtocol for LocalFileSystemProtocol { let abs_send_path = req.absolute_file_path_to_receive; let abs_receive_path = client_root.join(req.relative_file_path_to_upload); copy_with_temp_rename(abs_send_path, abs_receive_path) - .map_err(|e| BucketTransferProtocolError::IoError(e))?; + .map_err(BucketTransferProtocolError::IoError)?; Ok(()) } } |
