From c79e950ca22c7a957c11e510700664327b042115 Mon Sep 17 00:00:00 2001 From: Vika Date: Mon, 26 Aug 2024 14:08:07 +0300 Subject: Appease most clippy warnings The warnings only remain in places where I need them to remain, because I either need a reminder to implement something, or I need to refactor and simplify the code in question. --- src/media/storage/file.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/media/storage/file.rs') diff --git a/src/media/storage/file.rs b/src/media/storage/file.rs index 7250a6b..b9ab541 100644 --- a/src/media/storage/file.rs +++ b/src/media/storage/file.rs @@ -4,7 +4,7 @@ use std::{path::PathBuf, fmt::Debug}; use tokio::fs::OpenOptions; use tokio::io::{BufReader, BufWriter, AsyncWriteExt, AsyncSeekExt}; use futures::{StreamExt, TryStreamExt}; -use std::ops::{Bound, RangeBounds, Neg}; +use std::ops::{Bound, Neg}; use std::pin::Pin; use sha2::Digest; use futures::FutureExt; @@ -73,7 +73,7 @@ impl MediaStore for FileStore { let chunk = chunk.clone(); let tempfile = &mut tempfile; async move { - tempfile.write_all(&*chunk).await + tempfile.write_all(&chunk).await } }, { @@ -102,7 +102,7 @@ impl MediaStore for FileStore { tempfile.into_inner().sync_all().await?; let hash = hasher.finalize(); - debug!("Pending upload hash: {}", hex::encode(&hash)); + debug!("Pending upload hash: {}", hex::encode(hash)); let filename = format!( "{}/{}/{}/{}/{}", hex::encode([hash[0]]), @@ -117,7 +117,7 @@ impl MediaStore for FileStore { let metapath = self.base.join(domain_str.as_str()).join(&metafilename); let metatemppath = self.base.join(domain_str.as_str()).join(metafilename + ".tmp"); metadata.length = std::num::NonZeroUsize::new(length); - metadata.etag = Some(hex::encode(&hash)); + metadata.etag = Some(hex::encode(hash)); debug!("File path: {}, metadata: {}", filepath.display(), metapath.display()); { let parent = filepath.parent().unwrap(); -- cgit 1.4.1