From eaec59f5962536b224e5a66d76da5655f89654bf Mon Sep 17 00:00:00 2001 From: "Timothy J. Warren" Date: Thu, 11 Mar 2021 15:38:37 -0500 Subject: [PATCH] Add some clippy checks --- src/bigint.rs | 10 +++++----- src/lib.rs | 1 + 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/bigint.rs b/src/bigint.rs index 6269714..255b70b 100644 --- a/src/bigint.rs +++ b/src/bigint.rs @@ -1,7 +1,7 @@ #![allow(unused_variables)] //! \[WIP\] Arbitrarily large integers -use crate::num::Sign::*; -use crate::num::*; +use crate::num::FracOp; +use crate::num::Sign::{self, Positive, Negative}; #[cfg(all(feature = "alloc", not(feature = "std")))] extern crate alloc; @@ -423,7 +423,7 @@ impl Not for BigInt { fn not(self) -> Self::Output { let mut flipped: Vec = Vec::with_capacity(self.inner.len()); - for val in self.inner.iter() { + for val in &self.inner { let rev = !*val; flipped.push(rev); } @@ -529,7 +529,7 @@ macro_rules! impl_from_larger { loop { rem = quotient % target_radix; - quotient = quotient / target_radix; + quotient /= target_radix; inner.push(rem as usize); @@ -563,7 +563,7 @@ macro_rules! impl_from_larger { loop { rem = quotient % target_radix; - quotient = quotient / target_radix; + quotient /= target_radix; inner.push(rem as usize); diff --git a/src/lib.rs b/src/lib.rs index a25ec71..83e8c31 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -3,6 +3,7 @@ //! Playin' with Numerics in Rust #![forbid(unsafe_code)] #![no_std] +#![warn(clippy::all, clippy::pedantic)] #[cfg(all(feature = "alloc", not(feature = "std")))] #[macro_use]