Skip to content

Commit c9da598

Browse files
author
Devdutt Shenoi
committed
rename error type
1 parent 54dc85f commit c9da598

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/storage/s3.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ pub enum SSECEncryptionKey {
157157
}
158158

159159
#[derive(Debug, thiserror::Error)]
160-
pub enum Error {
160+
pub enum SSEError {
161161
#[error("Expected SSE-C:AES256:<base64_encryption_key>")]
162162
UnexpectedKey,
163163
#[error("Only SSE-C is supported for object encryption for now")]
@@ -167,16 +167,16 @@ pub enum Error {
167167
}
168168

169169
impl FromStr for SSECEncryptionKey {
170-
type Err = Error;
170+
type Err = SSEError;
171171

172172
fn from_str(s: &str) -> Result<Self, Self::Err> {
173173
let parts = s.split(':').collect::<Vec<_>>();
174174
if parts.len() != 3 {
175-
return Err(Error::UnexpectedKey);
175+
return Err(SSEError::UnexpectedKey);
176176
}
177177
let sse_type = parts[0];
178178
if sse_type != "SSE-C" {
179-
return Err(Error::UnexpectedProtocol);
179+
return Err(SSEError::UnexpectedProtocol);
180180
}
181181

182182
let algorithm = parts[1];
@@ -199,12 +199,12 @@ pub enum ObjectEncryptionAlgorithm {
199199
}
200200

201201
impl FromStr for ObjectEncryptionAlgorithm {
202-
type Err = Error;
202+
type Err = SSEError;
203203

204204
fn from_str(s: &str) -> Result<Self, Self::Err> {
205205
match s {
206206
"AES256" => Ok(ObjectEncryptionAlgorithm::Aes256),
207-
_ => Err(Error::InvalidAlgorithm),
207+
_ => Err(SSEError::InvalidAlgorithm),
208208
}
209209
}
210210
}

0 commit comments

Comments
 (0)