Skip to content

Commit

Permalink
Fix clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
cmpute committed Dec 31, 2023
1 parent f598436 commit f1eb119
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 3 deletions.
1 change: 1 addition & 0 deletions float/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ mod third_party;
mod utils;

// All the public items from third_party will be exposed
#[allow(unused_imports)]
pub use third_party::*;

pub use fbig::FBig;
Expand Down
2 changes: 2 additions & 0 deletions float/src/third_party/num_traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@ impl<R: Round, const B: Word> num_traits::Num for FBig<R, B> {
type FromStrRadixErr = ParseError;
#[inline]
fn from_str_radix(str: &str, radix: u32) -> Result<Self, Self::FromStrRadixErr> {
// the conversion might a fail with 16-bit words.
#[allow(clippy::unnecessary_fallible_conversions)]
let r: Word = radix.try_into().map_err(|_| ParseError::UnsupportedRadix)?;
if r == B {
Self::from_str_native(str)
Expand Down
1 change: 1 addition & 0 deletions integer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ mod third_party;
mod ubig;

// All the public items from third_party will be exposed
#[allow(unused_imports)]
pub use third_party::*;

// Re-export types for fast division
Expand Down
3 changes: 2 additions & 1 deletion integer/src/repr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,8 @@ impl Repr {
1 | 2 => {
TypedReprRef::RefSmall(double_word(self.data.inline[0], self.data.inline[1]))
}
_ => TypedReprRef::RefLarge(slice::from_raw_parts( // need Rust 1.64 for const
_ => TypedReprRef::RefLarge(slice::from_raw_parts(
// need Rust 1.64 for const
self.data.heap.0,
self.data.heap.1,
)),
Expand Down
6 changes: 4 additions & 2 deletions integer/tests/modular.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,10 @@ fn test_add_sub() {
),
];

#[allow(clippy::map_identity)]
let all_test_cases = test_cases
.iter()
.map(|(a, b, c)| (a, b, c))
.map(|(a, b, c)| (a, b, c)) // Need identity map to convert tuple ref to ref tuple
.chain(test_cases.iter().map(|(a, b, c)| (b, a, c)));

for (a, b, c) in all_test_cases {
Expand Down Expand Up @@ -201,9 +202,10 @@ fn test_mul() {
),
];

#[allow(clippy::map_identity)]
let all_test_cases = test_cases
.iter()
.map(|(a, b, c)| (a, b, c))
.map(|(a, b, c)| (a, b, c)) // Need identity map to convert tuple ref to ref tuple
.chain(test_cases.iter().map(|(a, b, c)| (b, a, c)));

for (a, b, c) in all_test_cases {
Expand Down
1 change: 1 addition & 0 deletions rational/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ mod simplify;
mod third_party;

// All the public items from third_party will be exposed
#[allow(unused_imports)]
pub use third_party::*;

pub use rbig::{RBig, Relaxed};

0 comments on commit f1eb119

Please sign in to comment.