From b0eeb4c4bcf96b2d2f754d5ea4487f083536ac59 Mon Sep 17 00:00:00 2001 From: DaniPopes <57450786+DaniPopes@users.noreply.github.com> Date: Thu, 22 Feb 2024 03:06:58 +0100 Subject: [PATCH] chore: remove unused imports --- src/algorithms/div/knuth.rs | 4 +++- src/bit_arr.rs | 1 + src/bytes.rs | 1 + src/cmp.rs | 2 +- src/lib.rs | 1 + src/mul.rs | 2 +- src/string.rs | 4 +++- src/support/arbitrary.rs | 4 +++- src/support/scale.rs | 4 +++- src/support/serde.rs | 8 ++++++-- src/utils.rs | 1 + 11 files changed, 24 insertions(+), 8 deletions(-) diff --git a/src/algorithms/div/knuth.rs b/src/algorithms/div/knuth.rs index dbaca63b..7ef4b9b2 100644 --- a/src/algorithms/div/knuth.rs +++ b/src/algorithms/div/knuth.rs @@ -193,13 +193,15 @@ pub fn div_nxm(numerator: &mut [u64], divisor: &mut [u64]) { mod tests { use super::*; use crate::algorithms::{addmul, cmp, sbb_n}; - use alloc::vec::Vec; use core::cmp::Ordering; use proptest::{ collection, num, proptest, strategy::{Just, Strategy}, }; + #[allow(unused_imports)] + use alloc::vec::Vec; + // Basic test without exceptional paths #[test] fn test_divrem_8by4() { diff --git a/src/bit_arr.rs b/src/bit_arr.rs index 3d53e864..f1c89548 100644 --- a/src/bit_arr.rs +++ b/src/bit_arr.rs @@ -8,6 +8,7 @@ use core::{ }; #[cfg(feature = "alloc")] +#[allow(unused_imports)] use alloc::{borrow::Cow, vec::Vec}; /// A newtype wrapper around [`Uint`] that restricts operations to those diff --git a/src/bytes.rs b/src/bytes.rs index cebff397..0034053c 100644 --- a/src/bytes.rs +++ b/src/bytes.rs @@ -5,6 +5,7 @@ use crate::Uint; use core::slice; #[cfg(feature = "alloc")] +#[allow(unused_imports)] use alloc::{borrow::Cow, vec::Vec}; // OPT: *_to_smallvec to avoid allocation. diff --git a/src/cmp.rs b/src/cmp.rs index dbe2b560..80832f6a 100644 --- a/src/cmp.rs +++ b/src/cmp.rs @@ -1,5 +1,5 @@ use crate::Uint; -use core::cmp::{Ord, Ordering, PartialOrd}; +use core::cmp::Ordering; impl Ord for Uint { #[inline] diff --git a/src/lib.rs b/src/lib.rs index 35da791f..20a19c9f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -25,6 +25,7 @@ // Unstable features #![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))] #![cfg_attr(feature = "nightly", feature(core_intrinsics))] +#![cfg_attr(feature = "nightly", allow(internal_features))] #![cfg_attr( feature = "generic_const_exprs", feature(generic_const_exprs), diff --git a/src/mul.rs b/src/mul.rs index 51c06768..51056038 100644 --- a/src/mul.rs +++ b/src/mul.rs @@ -180,7 +180,7 @@ impl_bin_op!(Mul, mul, MulAssign, mul_assign, wrapping_mul); #[cfg(test)] mod tests { use super::*; - use crate::{const_for, nlimbs}; + use crate::const_for; use proptest::proptest; #[test] diff --git a/src/string.rs b/src/string.rs index 37a37588..61392517 100644 --- a/src/string.rs +++ b/src/string.rs @@ -214,9 +214,11 @@ impl FromStr for Uint { #[cfg(test)] mod tests { use super::*; - use alloc::string::ToString; use proptest::proptest; + #[allow(unused_imports)] + use alloc::string::ToString; + #[allow(clippy::unreadable_literal)] const N: Uint<256, 4> = Uint::from_limbs([ 0xa8ec92344438aaf4_u64, diff --git a/src/support/arbitrary.rs b/src/support/arbitrary.rs index cd7e475e..f2e27c7d 100644 --- a/src/support/arbitrary.rs +++ b/src/support/arbitrary.rs @@ -34,9 +34,11 @@ impl<'a, const BITS: usize, const LIMBS: usize> Arbitrary<'a> for Uint`, /// and minimal human-readable `Uint::ZERO` for any bit size. const ZERO_STR: &str = "0x0"; @@ -175,9 +177,11 @@ impl<'de, const BITS: usize, const LIMBS: usize> Visitor<'de> for ByteVisitor