Skip to content

Commit

Permalink
fix: nightly flags and clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel-Aaron-Bloom committed Jun 13, 2024
1 parent 2a926b3 commit 60461c6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/into.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ unsafe impl<T, const N: usize> IntoIteratorFixed<N> for [T; N] {
/// ```
fn into_iter_fixed(self) -> IteratorFixed<array::IntoIter<T, N>, 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)) }
}
}

Expand Down
5 changes: 1 addition & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -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;

Expand Down
6 changes: 3 additions & 3 deletions tests/test.rs
Original file line number Diff line number Diff line change
@@ -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;

Expand All @@ -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")]
Expand Down

0 comments on commit 60461c6

Please sign in to comment.