From 304048bdd90a41d7effb6cafc9a835fd3fcf87c5 Mon Sep 17 00:00:00 2001 From: Michael Dyer <59163924+MichaelOwenDyer@users.noreply.github.com> Date: Thu, 7 Mar 2024 09:34:53 +0100 Subject: [PATCH] Fix redundant import warnings (#1405) --- rand_core/src/block.rs | 1 - rand_core/src/le.rs | 2 -- rand_core/src/lib.rs | 3 --- src/distributions/float.rs | 1 - src/distributions/other.rs | 1 - src/distributions/uniform.rs | 1 - src/distributions/weighted_index.rs | 1 - src/seq/mod.rs | 2 -- 8 files changed, 12 deletions(-) diff --git a/rand_core/src/block.rs b/rand_core/src/block.rs index a8cefc8e40c..9122f9bc675 100644 --- a/rand_core/src/block.rs +++ b/rand_core/src/block.rs @@ -55,7 +55,6 @@ use crate::impls::{fill_via_u32_chunks, fill_via_u64_chunks}; use crate::{Error, CryptoRng, RngCore, SeedableRng}; -use core::convert::AsRef; use core::fmt; #[cfg(feature = "serde1")] use serde::{Deserialize, Serialize}; diff --git a/rand_core/src/le.rs b/rand_core/src/le.rs index ed42e57f478..89e5e729c8a 100644 --- a/rand_core/src/le.rs +++ b/rand_core/src/le.rs @@ -11,8 +11,6 @@ //! Little-Endian order has been chosen for internal usage; this makes some //! useful functions available. -use core::convert::TryInto; - /// Reads unsigned 32 bit integers from `src` into `dst`. #[inline] pub fn read_u32_into(src: &[u8], dst: &mut [u32]) { diff --git a/rand_core/src/lib.rs b/rand_core/src/lib.rs index 292c57ffb8b..d42ab8d63ef 100644 --- a/rand_core/src/lib.rs +++ b/rand_core/src/lib.rs @@ -38,9 +38,6 @@ #![cfg_attr(doc_cfg, feature(doc_cfg))] #![no_std] -use core::convert::AsMut; -use core::default::Default; - #[cfg(feature = "alloc")] extern crate alloc; #[cfg(feature = "std")] extern crate std; #[cfg(feature = "alloc")] use alloc::boxed::Box; diff --git a/src/distributions/float.rs b/src/distributions/float.rs index 37b71612a1b..4414cc74988 100644 --- a/src/distributions/float.rs +++ b/src/distributions/float.rs @@ -172,7 +172,6 @@ float_impls! { f64x8, u64x8, f64, u64, 52, 1023 } #[cfg(test)] mod tests { use super::*; - use crate::distributions::utils::FloatAsSIMD; use crate::rngs::mock::StepRng; const EPSILON32: f32 = ::core::f32::EPSILON; diff --git a/src/distributions/other.rs b/src/distributions/other.rs index ebe3d57ed3f..596b8962c1e 100644 --- a/src/distributions/other.rs +++ b/src/distributions/other.rs @@ -281,7 +281,6 @@ where Standard: Distribution mod tests { use super::*; use crate::RngCore; - #[cfg(feature = "alloc")] use alloc::string::String; #[test] fn test_misc() { diff --git a/src/distributions/uniform.rs b/src/distributions/uniform.rs index 5e6b6ae3f9e..ecf90520b21 100644 --- a/src/distributions/uniform.rs +++ b/src/distributions/uniform.rs @@ -106,7 +106,6 @@ use core::fmt; use core::time::Duration; use core::ops::{Range, RangeInclusive}; -use core::convert::TryFrom; use crate::distributions::float::IntoFloat; use crate::distributions::utils::{BoolAsSIMD, FloatAsSIMD, FloatSIMDUtils, IntAsSIMD, WideningMultiply}; diff --git a/src/distributions/weighted_index.rs b/src/distributions/weighted_index.rs index 49cb02d6ade..59ff1c1915d 100644 --- a/src/distributions/weighted_index.rs +++ b/src/distributions/weighted_index.rs @@ -11,7 +11,6 @@ use crate::distributions::uniform::{SampleBorrow, SampleUniform, UniformSampler}; use crate::distributions::Distribution; use crate::Rng; -use core::cmp::PartialOrd; use core::fmt; // Note that this whole module is only imported if feature="alloc" is enabled. diff --git a/src/seq/mod.rs b/src/seq/mod.rs index f5cbc6008e9..908021ad3dc 100644 --- a/src/seq/mod.rs +++ b/src/seq/mod.rs @@ -712,8 +712,6 @@ fn gen_index(rng: &mut R, ubound: usize) -> usize { #[cfg(test)] mod test { use super::*; - #[cfg(feature = "alloc")] - use crate::Rng; #[cfg(all(feature = "alloc", not(feature = "std")))] use alloc::vec::Vec;