Warning fix
simodels Build / Rustfmt (pull_request) Successful in 1m3s
labyrinth release Tagging / release (pull_request) Successful in 1m9s
simodels Build / Clippy (pull_request) Successful in 1m51s
simodels Build / build (pull_request) Successful in 1m54s
simodels Build / Check (pull_request) Successful in 1m57s
simodels Build / Test Suite (pull_request) Successful in 2m10s

This commit is contained in:
phoenix committed 2026-10-08 18:55:36 -04:00
1 parent 0f007c0808
commit d6112754d0
1 file changed
+8 -8
+8 -8
View File
@@ -52,12 +52,12 @@ impl Labyrinth {
&self, &self,
file_key: &str, file_key: &str,
data: &Data, data: &Data,
) -> Result<aws_sdk_s3::operation::put_object::PutObjectOutput, Error> { ) -> Result<aws_sdk_s3::operation::put_object::PutObjectOutput, Box<Error>> {
let client = init_client(&self.config).await; let client = init_client(&self.config).await;
let data_content = if data.raw_data.is_empty() { let data_content = if data.raw_data.is_empty() {
match load_data(&data.filepath).await { match load_data(&data.filepath).await {
Ok(content) => content, Ok(content) => content,
Err(err) => return Err(Error::Info(err.to_string())), Err(err) => return Err(Box::new(Error::Info(err.to_string()))),
} }
} else { } else {
data.raw_data.to_owned() data.raw_data.to_owned()
@@ -74,12 +74,12 @@ impl Labyrinth {
.await .await
{ {
Ok(response) => Ok(response), Ok(response) => Ok(response),
Err(err) => Err(Error::Info(err.to_string())), Err(err) => Err(Box::new(Error::Info(err.to_string()))),
} }
} }
/// Download object from the bucket /// Download object from the bucket
pub async fn download(&self, file_key: &str) -> Result<Vec<u8>, Error> { pub async fn download(&self, file_key: &str) -> Result<Vec<u8>, Box<Error>> {
let client = init_client(&self.config).await; let client = init_client(&self.config).await;
match client match client
@@ -99,10 +99,10 @@ impl Labyrinth {
let raw_data = bytes.to_vec(); let raw_data = bytes.to_vec();
Ok(raw_data) Ok(raw_data)
} }
Err(err) => Err(Error::Info(err.to_string())), Err(err) => Err(Box::new(Error::Info(err.to_string()))),
} }
} }
Err(err) => Err(Error::Info(err.to_string())), Err(err) => Err(Box::new(Error::Info(err.to_string()))),
} }
} }
@@ -110,7 +110,7 @@ impl Labyrinth {
pub async fn delete( pub async fn delete(
&self, &self,
file_key: &str, file_key: &str,
) -> Result<aws_sdk_s3::operation::delete_object::DeleteObjectOutput, Error> { ) -> Result<aws_sdk_s3::operation::delete_object::DeleteObjectOutput, Box<Error>> {
let client = init_client(&self.config).await; let client = init_client(&self.config).await;
match client match client
@@ -121,7 +121,7 @@ impl Labyrinth {
.await .await
{ {
Ok(response) => Ok(response), Ok(response) => Ok(response),
Err(err) => Err(Error::Info(err.to_string())), Err(err) => Err(Box::new(Error::Info(err.to_string()))),
} }
} }
} }