-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reorganising the code with proper crate structure #55
Conversation
|
||
pub async fn create(&self, bucket: &str, key: &str, data: &[u8]) -> CeriumResult<()> { | ||
let _bucket_obj = self.get_bucket(bucket)?; | ||
let result = _bucket_obj.put_object(key, data).await?; |
Check warning
Code scanning / clippy
unused variable: result Warning
Ok(()) | ||
} | ||
|
||
pub async fn delete(&self, bucket: &String, key: &String) -> CeriumResult<()> { |
Check warning
Code scanning / clippy
writing &String instead of &str involves a new object where a slice will do Warning
return S3Client::new( | ||
&std::env::var("STORAGE_ACCESS_KEY").expect("STORAGE_ACCESS_KEY must be set."), | ||
&std::env::var("STORAGE_ACCESS_SECRET").expect("STORAGE_ACCESS_SECRET must be set."), | ||
&std::env::var("STORAGE_BASE_URL").expect("STORAGE_BASE_URL must be set."), | ||
) | ||
.expect("Error While create Storage Client"); |
Check warning
Code scanning / clippy
unneeded return statement Warning
use std::fs; | ||
use std::io::Write; | ||
|
||
use s3::Region; |
Check warning
Code scanning / clippy
unused import: s3::Region Warning
file.write_all(&*result).expect("error"); | ||
|
||
let content = self.driver.take_screenshot().await?; | ||
let result = self.storage_cli.create("orca", format!("{id}.png").as_str(), content.as_slice()).await; |
Check warning
Code scanning / clippy
unused variable: result Warning
kind: Set(BlockKind::Reference), | ||
type_field: Set(BlockType::ActionGroup), | ||
reference: Set(Some(app_g.clone().id)), | ||
parent_id: Set(Some(uuid2.clone())), |
Check warning
Code scanning / clippy
using clone on type Uuid which implements the Copy trait Warning
@@ -1,3 +1,4 @@ | |||
use std::sync::Arc; |
Check warning
Code scanning / clippy
unused import: std::sync::Arc Warning
ActiveModelTrait, ColumnTrait, DatabaseTransaction, EntityTrait, IntoActiveModel, QueryFilter, | ||
QueryOrder, QuerySelect, TryIntoModel, | ||
}; | ||
use futures::executor::block_on; |
Check warning
Code scanning / clippy
unused import: futures::executor::block_on Warning
QueryOrder, QuerySelect, TryIntoModel, | ||
}; | ||
use futures::executor::block_on; | ||
use sea_orm::{ActiveModelTrait, ColumnTrait, DatabaseTransaction, EntityTrait, IntoActiveModel, ModelTrait, NotSet, QueryFilter, QueryOrder, QuerySelect, TryIntoModel}; |
Check warning
Code scanning / clippy
unused import: ModelTrait Warning
QueryOrder, QuerySelect, TryIntoModel, | ||
}; | ||
use futures::executor::block_on; | ||
use sea_orm::{ActiveModelTrait, ColumnTrait, DatabaseTransaction, EntityTrait, IntoActiveModel, ModelTrait, NotSet, QueryFilter, QueryOrder, QuerySelect, TryIntoModel}; |
Check warning
Code scanning / clippy
unused imports: ModelTrait, NotSet Warning
No description provided.