Skip to content

Commit

Permalink
assert_equal: fix clippy::default_numeric_fallback
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
Philippe-Cholet committed May 14, 2024
1 parent d1ce07d commit fa94ba1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -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)]

Expand Down Expand Up @@ -4225,7 +4225,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,
Expand Down

0 comments on commit fa94ba1

Please sign in to comment.