From 357cf866ac00c28e4247439a713bff4e00e9a21e Mon Sep 17 00:00:00 2001 From: houseme Date: Tue, 8 Sep 2026 02:05:40 +0800 Subject: [PATCH] fix(api): merge duplicate storage error message branch Combine the MaxVersionsExceeded and InternalError Io message cases so the mapping keeps the same S3 response semantics without tripping clippy's if_same_then_else lint. Co-Authored-By: heihutu Co-Authored-By: zhi22915 --- rustfs/src/error.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rustfs/src/error.rs b/rustfs/src/error.rs index 773f7b869..be2a86187 100644 --- a/rustfs/src/error.rs +++ b/rustfs/src/error.rs @@ -496,9 +496,9 @@ impl From for ApiError { let message = if matches!(&err, StorageError::QuotaExceeded { .. }) { err.to_string() - } else if matches!(&err, StorageError::MaxVersionsExceeded) { - ApiError::error_code_to_message(&code) - } else if code == S3ErrorCode::InternalError && matches!(&err, StorageError::Io(_)) { + } else if matches!(&err, StorageError::MaxVersionsExceeded) + || (code == S3ErrorCode::InternalError && matches!(&err, StorageError::Io(_))) + { ApiError::error_code_to_message(&code) } else if code == S3ErrorCode::InternalError { err.to_string()