From ac2fa82c17bc06c7b8384bc4cdaa21c16bba485f Mon Sep 17 00:00:00 2001 From: Daniel Bloom <7810950-Daniel.Aaron.Bloom@users.noreply.gitlab.com> Date: Wed, 12 Jun 2024 17:26:05 -0700 Subject: [PATCH] fix: nightly flags and clippy warnings --- src/into.rs | 2 +- src/lib.rs | 5 +---- tests/test.rs | 6 +++--- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/into.rs b/src/into.rs index e3af7a1..c021113 100644 --- a/src/into.rs +++ b/src/into.rs @@ -73,7 +73,7 @@ unsafe impl IntoIteratorFixed for [T; N] { /// ``` fn into_iter_fixed(self) -> IteratorFixed, N> { // Safety: array::IntoIter::new([T; N]) always yields N elements - unsafe { IteratorFixed::from_iter(array::IntoIter::new(self)) } + unsafe { IteratorFixed::from_iter(<[T; N] as IntoIterator>::into_iter(self)) } } } diff --git a/src/lib.rs b/src/lib.rs index f17e22f..3ad5097 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,10 +1,7 @@ #![no_std] #![allow(stable_features)] #![cfg_attr(feature = "nightly_features", allow(incomplete_features))] -#![cfg_attr( - feature = "nightly_features", - feature(const_generics, const_evaluatable_checked) -)] +#![cfg_attr(feature = "nightly_features", feature(generic_const_exprs))] use core::iter; diff --git a/tests/test.rs b/tests/test.rs index 376a500..3c36708 100644 --- a/tests/test.rs +++ b/tests/test.rs @@ -1,5 +1,5 @@ #![cfg_attr(feature = "nightly_features", allow(incomplete_features))] -#![cfg_attr(feature = "nightly_features", feature(const_generics))] +#![cfg_attr(feature = "nightly_features", feature(generic_const_exprs))] extern crate iter_fixed; @@ -15,11 +15,11 @@ fn test() { assert_eq!(res, [5, 5, 5, 5]); - let foo: [(_, _); 3] = [1, 2, 3] + let res: [(_, _); 3] = [1, 2, 3] .into_iter_fixed() .zip(core::iter::repeat(42)) .collect(); - assert_eq!(foo, [(1, 42), (2, 42), (3, 42)]); + assert_eq!(res, [(1, 42), (2, 42), (3, 42)]); } #[cfg(feature = "nightly_features")]