Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/test-utils/src/minicore.rs')
| -rw-r--r-- | crates/test-utils/src/minicore.rs | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/crates/test-utils/src/minicore.rs b/crates/test-utils/src/minicore.rs index 167af32a2e..308dc5892e 100644 --- a/crates/test-utils/src/minicore.rs +++ b/crates/test-utils/src/minicore.rs @@ -891,12 +891,19 @@ pub mod iter { self } } - pub struct IntoIter<T, const N: usize>([T; N]); + struct IndexRange { + start: usize, + end: usize, + } + pub struct IntoIter<T, const N: usize> { + data: [T; N], + range: IndexRange, + } impl<T, const N: usize> IntoIterator for [T; N] { type Item = T; type IntoIter = IntoIter<T, N>; fn into_iter(self) -> I { - IntoIter(self) + IntoIter { data: self, range: IndexRange { start: 0, end: self.len() } } } } impl<T, const N: usize> Iterator for IntoIter<T, N> { |