diff --git a/src/cache/disk.rs b/src/cache/disk.rs index b6fe8c7..9894e28 100644 --- a/src/cache/disk.rs +++ b/src/cache/disk.rs @@ -462,7 +462,7 @@ mod remove_file_handler { use tempfile::tempdir; use tokio::fs::{create_dir_all, remove_dir_all}; - use super::{File, remove_file_handler}; + use super::{remove_file_handler, File}; #[tokio::test] async fn should_not_panic_on_invalid_path() { @@ -568,7 +568,7 @@ mod db { use sqlx::{Connection, Row, SqliteConnection}; use std::error::Error; - use super::{Cache, ConnectOptions, DiskCache, FromStr, Ordering, PathBuf, StreamExt, handle_db_get, handle_db_put}; + use super::{handle_db_get, handle_db_put, DiskCache, FromStr, Ordering, PathBuf, StreamExt}; #[tokio::test] #[cfg_attr(miri, ignore)] diff --git a/src/cache/fs.rs b/src/cache/fs.rs index e975a7f..0d04776 100644 --- a/src/cache/fs.rs +++ b/src/cache/fs.rs @@ -469,7 +469,10 @@ mod read_file_compat { mod metadata_future { use std::{collections::VecDeque, io::ErrorKind}; - use super::{AsyncBufRead, AsyncRead, AsyncReadExt, BufReader, Context, Error, MetadataFuture, NewCipher, Pin, Poll, ReadBuf}; + use super::{ + AsyncBufRead, AsyncRead, AsyncReadExt, BufReader, Context, Error, MetadataFuture, Pin, + Poll, ReadBuf, + }; use crate::cache::ImageContentType; use chrono::DateTime; @@ -519,7 +522,6 @@ mod metadata_future { match pinned.fill_buf_events.pop_front() { Some(Poll::Ready(Ok(bytes))) => { pinned.buffer.extend_from_slice(bytes); - String::from_utf8_lossy(&pinned.buffer); return Poll::Ready(Ok(pinned.buffer.as_ref())); } Some(res @ Poll::Ready(_)) => res,