From c9da5982d375c5aee474eb3d3a6733424731b9c3 Mon Sep 17 00:00:00 2001 From: Devdutt Shenoi Date: Sun, 8 Dec 2024 03:28:31 +0530 Subject: [PATCH] rename error type --- src/storage/s3.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/storage/s3.rs b/src/storage/s3.rs index 76430061e..c04bab9af 100644 --- a/src/storage/s3.rs +++ b/src/storage/s3.rs @@ -157,7 +157,7 @@ pub enum SSECEncryptionKey { } #[derive(Debug, thiserror::Error)] -pub enum Error { +pub enum SSEError { #[error("Expected SSE-C:AES256:")] UnexpectedKey, #[error("Only SSE-C is supported for object encryption for now")] @@ -167,16 +167,16 @@ pub enum Error { } impl FromStr for SSECEncryptionKey { - type Err = Error; + type Err = SSEError; fn from_str(s: &str) -> Result { let parts = s.split(':').collect::>(); if parts.len() != 3 { - return Err(Error::UnexpectedKey); + return Err(SSEError::UnexpectedKey); } let sse_type = parts[0]; if sse_type != "SSE-C" { - return Err(Error::UnexpectedProtocol); + return Err(SSEError::UnexpectedProtocol); } let algorithm = parts[1]; @@ -199,12 +199,12 @@ pub enum ObjectEncryptionAlgorithm { } impl FromStr for ObjectEncryptionAlgorithm { - type Err = Error; + type Err = SSEError; fn from_str(s: &str) -> Result { match s { "AES256" => Ok(ObjectEncryptionAlgorithm::Aes256), - _ => Err(Error::InvalidAlgorithm), + _ => Err(SSEError::InvalidAlgorithm), } } }