Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: nightly flags and clippy warnings #20

Merged
merged 1 commit into from
Jun 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading