lint tests

This commit is contained in:
Edward Shen 2022-03-26 16:30:50 -07:00
parent e404d144a2
commit 1152f775b9
Signed by: edward
GPG key ID: 19182661E818369F
2 changed files with 6 additions and 4 deletions

4
src/cache/disk.rs vendored
View file

@ -462,7 +462,7 @@ mod remove_file_handler {
use tempfile::tempdir; use tempfile::tempdir;
use tokio::fs::{create_dir_all, remove_dir_all}; use tokio::fs::{create_dir_all, remove_dir_all};
use super::{File, remove_file_handler}; use super::{remove_file_handler, File};
#[tokio::test] #[tokio::test]
async fn should_not_panic_on_invalid_path() { async fn should_not_panic_on_invalid_path() {
@ -568,7 +568,7 @@ mod db {
use sqlx::{Connection, Row, SqliteConnection}; use sqlx::{Connection, Row, SqliteConnection};
use std::error::Error; 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] #[tokio::test]
#[cfg_attr(miri, ignore)] #[cfg_attr(miri, ignore)]

6
src/cache/fs.rs vendored
View file

@ -469,7 +469,10 @@ mod read_file_compat {
mod metadata_future { mod metadata_future {
use std::{collections::VecDeque, io::ErrorKind}; 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 crate::cache::ImageContentType;
use chrono::DateTime; use chrono::DateTime;
@ -519,7 +522,6 @@ mod metadata_future {
match pinned.fill_buf_events.pop_front() { match pinned.fill_buf_events.pop_front() {
Some(Poll::Ready(Ok(bytes))) => { Some(Poll::Ready(Ok(bytes))) => {
pinned.buffer.extend_from_slice(bytes); pinned.buffer.extend_from_slice(bytes);
String::from_utf8_lossy(&pinned.buffer);
return Poll::Ready(Ok(pinned.buffer.as_ref())); return Poll::Ready(Ok(pinned.buffer.as_ref()));
} }
Some(res @ Poll::Ready(_)) => res, Some(res @ Poll::Ready(_)) => res,