From 2ad9e07ae860bb891e48b35edfea5b3286dcb4ab Mon Sep 17 00:00:00 2001 From: Philippe-Cholet <44676486+Philippe-Cholet@users.noreply.github.com> Date: Wed, 8 May 2024 23:39:48 +0200 Subject: [PATCH] `assert_equal`: fix `clippy::default_numeric_fallback` Type of `i` defaults to `i32` when `usize` should be used. It's only a problem if this function is called with two iterators longer than `i32::MAX`. It seems unlikely to me but who knows? `i32` should not be the default integer type in the library. `usize` would have more sense so I add the lint as warning (for the library only, it's okay in tests and benchmarks). --- src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index c439fcfef..f4de79c50 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,4 +1,4 @@ -#![warn(missing_docs)] +#![warn(missing_docs, clippy::default_numeric_fallback)] #![crate_name = "itertools"] #![cfg_attr(not(feature = "use_std"), no_std)] @@ -4277,7 +4277,7 @@ where { let mut ia = a.into_iter(); let mut ib = b.into_iter(); - let mut i = 0; + let mut i: usize = 0; loop { match (ia.next(), ib.next()) { (None, None) => return,