Skip to content

Commit

Permalink
enable clippy::ignored_unit_patterns lint and do fixes
Browse files Browse the repository at this point in the history
matching over `()` is more explicit, use `()` instead of `_`
for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ignored_unit_patterns
  • Loading branch information
gwen-lg authored and usbalbin committed Jun 16, 2024
1 parent 2229fcf commit 9f22529
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/from.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,6 @@ impl<T, const N: usize> FromIteratorFixed<T, N> for [T; N] {
let IteratorFixed { inner: mut it } = iter_fixed;
// We know that it will yield N elements due to it originating from an IteratorFixed
// of size N
[(); N].map(|_| it.next().unwrap())
[(); N].map(|()| it.next().unwrap())
}
}
3 changes: 2 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#![cfg_attr(feature = "nightly_features", feature(generic_const_exprs))]
// enable additionnal lints
#![warn(clippy::doc_markdown)]
#![warn(clippy::ignored_unit_patterns)]

use core::iter;

Expand Down Expand Up @@ -65,7 +66,7 @@ where
[(); N]
.into_iter_fixed()
.enumerate()
.map(move |(i, _)| f(i))
.map(move |(i, ())| f(i))
}

impl<I, const N: usize> IteratorFixed<I, N>
Expand Down

0 comments on commit 9f22529

Please sign in to comment.