From ea945c50f2e215ec436c72d247e7f6695593a516 Mon Sep 17 00:00:00 2001 From: houseme Date: Tue, 8 Sep 2026 00:20:26 +0800 Subject: [PATCH] fix(error): merge equivalent api message branches Combine the MaxVersionsExceeded and internal IO message branches so Clippy no longer flags identical if blocks while preserving the existing response messages. 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()