mirror of
https://github.com/rustfs/rustfs.git
synced 2026-09-07 20:46:11 +00:00
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 <heihutu@gmail.com> Co-Authored-By: zhi22915 <qiuzgang@gmail.com>
This commit is contained in:
+3
-3
@@ -496,9 +496,9 @@ impl From<StorageError> for ApiError {
|
|||||||
|
|
||||||
let message = if matches!(&err, StorageError::QuotaExceeded { .. }) {
|
let message = if matches!(&err, StorageError::QuotaExceeded { .. }) {
|
||||||
err.to_string()
|
err.to_string()
|
||||||
} else if matches!(&err, StorageError::MaxVersionsExceeded) {
|
} else if matches!(&err, StorageError::MaxVersionsExceeded)
|
||||||
ApiError::error_code_to_message(&code)
|
|| (code == S3ErrorCode::InternalError && matches!(&err, StorageError::Io(_)))
|
||||||
} else if code == S3ErrorCode::InternalError && matches!(&err, StorageError::Io(_)) {
|
{
|
||||||
ApiError::error_code_to_message(&code)
|
ApiError::error_code_to_message(&code)
|
||||||
} else if code == S3ErrorCode::InternalError {
|
} else if code == S3ErrorCode::InternalError {
|
||||||
err.to_string()
|
err.to_string()
|
||||||
|
|||||||
Reference in New Issue
Block a user