From 9f22529036aff7afc46c58d6b653cfb874dc00bc Mon Sep 17 00:00:00 2001 From: Gwen Lg Date: Sun, 16 Jun 2024 14:30:58 +0200 Subject: [PATCH] enable clippy::ignored_unit_patterns lint and do fixes 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 --- src/from.rs | 2 +- src/lib.rs | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/from.rs b/src/from.rs index 107f239..db9e861 100644 --- a/src/from.rs +++ b/src/from.rs @@ -61,6 +61,6 @@ impl FromIteratorFixed 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()) } } diff --git a/src/lib.rs b/src/lib.rs index 2bfb52d..62c40be 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -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; @@ -65,7 +66,7 @@ where [(); N] .into_iter_fixed() .enumerate() - .map(move |(i, _)| f(i)) + .map(move |(i, ())| f(i)) } impl IteratorFixed