diff --git a/crates/librqbit/src/storage/mod.rs b/crates/librqbit/src/storage/mod.rs index 6e0094d..c85df48 100644 --- a/crates/librqbit/src/storage/mod.rs +++ b/crates/librqbit/src/storage/mod.rs @@ -22,11 +22,11 @@ pub trait StorageFactoryExt { impl StorageFactoryExt for SF { fn boxed(self) -> BoxStorageFactory { - struct BoxFactory { + struct Wrapper { sf: SF, } - impl StorageFactory for BoxFactory { + impl StorageFactory for Wrapper { type Storage = Box; fn init_storage(&self, info: &ManagedTorrentInfo) -> anyhow::Result { @@ -35,7 +35,7 @@ impl StorageFactoryExt for SF { } } - Box::new(BoxFactory { sf: self }) + Box::new(Wrapper { sf: self }) } } diff --git a/crates/librqbit/src/storage/slow.rs b/crates/librqbit/src/storage/slow.rs index 72758ec..ac2c315 100644 --- a/crates/librqbit/src/storage/slow.rs +++ b/crates/librqbit/src/storage/slow.rs @@ -1,6 +1,5 @@ use std::time::Duration; -use rand::Rng; use rand_distr::Distribution; use super::{StorageFactory, TorrentStorage}; @@ -44,6 +43,7 @@ fn random_duration() -> Duration { let micros = 340f64 + sl * 200.; // 16 is max blocking threads let micros = micros.max(0.001) * 4. * 16.; + #[allow(clippy::cast_possible_truncation)] Duration::from_micros(micros as u64) }