diff options
author | Vika <vika@fireburn.ru> | 2024-08-26 14:08:07 +0300 |
---|---|---|
committer | Vika <vika@fireburn.ru> | 2024-08-26 14:36:57 +0300 |
commit | c79e950ca22c7a957c11e510700664327b042115 (patch) | |
tree | 1387e5931dd08cea0d21b2770964e169d7043905 /src/media/storage | |
parent | 1a4a9b85b9bf9ae8650a2cd68416476c7d1770b3 (diff) | |
download | kittybox-c79e950ca22c7a957c11e510700664327b042115.tar.zst |
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.
Diffstat (limited to 'src/media/storage')
-rw-r--r-- | src/media/storage/file.rs | 8 |
1 files changed, 4 insertions, 4 deletions
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(); |