From 6adeee1e5ac98fe9f81a8c1b98ce211ce07b397b 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 ff14cf94e..0ba63462a 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)] @@ -4222,7 +4222,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,