From 926b3c0fadcd10b4ef75c7d8995170ac3d16ca89 Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Wed, 18 May 2022 00:27:57 +0200 Subject: Rename error varian for Clippy --- src/api/k2v/error.rs | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src/api/k2v') diff --git a/src/api/k2v/error.rs b/src/api/k2v/error.rs index dbd9a5f5..9263d9be 100644 --- a/src/api/k2v/error.rs +++ b/src/api/k2v/error.rs @@ -15,7 +15,7 @@ use crate::signature::error::Error as SignatureError; pub enum Error { #[error(display = "{}", _0)] /// Error from common error - CommonError(CommonError), + Common(CommonError), // Category: cannot process /// Authorization Header Malformed @@ -48,7 +48,7 @@ where CommonError: From, { fn from(err: T) -> Self { - Error::CommonError(CommonError::from(err)) + Error::Common(CommonError::from(err)) } } @@ -57,13 +57,13 @@ impl CommonErrorDerivative for Error {} impl From for Error { fn from(err: HelperError) -> Self { match err { - HelperError::Internal(i) => Self::CommonError(CommonError::InternalError(i)), - HelperError::BadRequest(b) => Self::CommonError(CommonError::BadRequest(b)), + HelperError::Internal(i) => Self::Common(CommonError::InternalError(i)), + HelperError::BadRequest(b) => Self::Common(CommonError::BadRequest(b)), HelperError::InvalidBucketName(n) => { - Self::CommonError(CommonError::InvalidBucketName(n)) + Self::Common(CommonError::InvalidBucketName(n)) } - HelperError::NoSuchBucket(n) => Self::CommonError(CommonError::NoSuchBucket(n)), - e => Self::CommonError(CommonError::BadRequest(format!("{}", e))), + HelperError::NoSuchBucket(n) => Self::Common(CommonError::NoSuchBucket(n)), + e => Self::Common(CommonError::BadRequest(format!("{}", e))), } } } @@ -71,7 +71,7 @@ impl From for Error { impl From for Error { fn from(err: SignatureError) -> Self { match err { - SignatureError::CommonError(c) => Self::CommonError(c), + SignatureError::Common(c) => Self::Common(c), SignatureError::AuthorizationHeaderMalformed(c) => { Self::AuthorizationHeaderMalformed(c) } @@ -87,7 +87,7 @@ impl Error { /// as we are building a custom API fn code(&self) -> &'static str { match self { - Error::CommonError(c) => c.aws_code(), + Error::Common(c) => c.aws_code(), Error::NoSuchKey => "NoSuchKey", Error::NotAcceptable(_) => "NotAcceptable", Error::AuthorizationHeaderMalformed(_) => "AuthorizationHeaderMalformed", @@ -102,7 +102,7 @@ impl ApiError for Error { /// Get the HTTP status code that best represents the meaning of the error for the client fn http_status_code(&self) -> StatusCode { match self { - Error::CommonError(c) => c.http_status_code(), + Error::Common(c) => c.http_status_code(), Error::NoSuchKey => StatusCode::NOT_FOUND, Error::NotAcceptable(_) => StatusCode::NOT_ACCEPTABLE, Error::AuthorizationHeaderMalformed(_) -- cgit v1.2.3