You've already forked AstralRinth
forked from didirus/AstralRinth
Fix all default clippy warnings (#480)
All trivial, fixes were for: - #[deny(clippy::if_same_then_else)] - #[warn(clippy::explicit_auto_deref)] - #[warn(clippy::bool_assert_comparison)] Co-authored-by: Geometrically <18202329+Geometrically@users.noreply.github.com>
This commit is contained in:
@@ -26,9 +26,8 @@ impl FileHost for MockHost {
|
||||
std::fs::create_dir_all(
|
||||
path.parent().ok_or(FileHostingError::InvalidFilename)?,
|
||||
)?;
|
||||
let content_sha1 = sha1::Sha1::from(&*file_bytes).hexdigest();
|
||||
let content_sha512 =
|
||||
format!("{:x}", sha2::Sha512::digest(&*file_bytes));
|
||||
let content_sha1 = sha1::Sha1::from(&file_bytes).hexdigest();
|
||||
let content_sha512 = format!("{:x}", sha2::Sha512::digest(&file_bytes));
|
||||
|
||||
std::fs::write(path, &*file_bytes)?;
|
||||
Ok(UploadFileData {
|
||||
|
||||
@@ -65,13 +65,12 @@ impl FileHost for S3Host {
|
||||
file_bytes: Bytes,
|
||||
) -> Result<UploadFileData, FileHostingError> {
|
||||
let content_sha1 = sha1::Sha1::from(&file_bytes).hexdigest();
|
||||
let content_sha512 =
|
||||
format!("{:x}", sha2::Sha512::digest(&*file_bytes));
|
||||
let content_sha512 = format!("{:x}", sha2::Sha512::digest(&file_bytes));
|
||||
|
||||
self.bucket
|
||||
.put_object_with_content_type(
|
||||
format!("/{}", file_name),
|
||||
&*file_bytes,
|
||||
&file_bytes,
|
||||
content_type,
|
||||
)
|
||||
.await
|
||||
|
||||
Reference in New Issue
Block a user