Skip to content

Commit 2ad9e07

Browse files
Philippe-Choletjswrenn
authored andcommitted
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).
1 parent 0d4efc8 commit 2ad9e07

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![warn(missing_docs)]
1+
#![warn(missing_docs, clippy::default_numeric_fallback)]
22
#![crate_name = "itertools"]
33
#![cfg_attr(not(feature = "use_std"), no_std)]
44

@@ -4277,7 +4277,7 @@ where
42774277
{
42784278
let mut ia = a.into_iter();
42794279
let mut ib = b.into_iter();
4280-
let mut i = 0;
4280+
let mut i: usize = 0;
42814281
loop {
42824282
match (ia.next(), ib.next()) {
42834283
(None, None) => return,

0 commit comments

Comments
 (0)