Skip to content

Commit 14d2fa2

Browse files
Philippe-Choletphimuemue
authored andcommitted
impl FusedIterator for Permutations
1 parent c9fdd48 commit 14d2fa2

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/permutations.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
use alloc::vec::Vec;
22
use std::fmt;
33
use std::iter::once;
4+
use std::iter::FusedIterator;
45

56
use super::lazy_buffer::LazyBuffer;
67
use crate::size_hint::{self, SizeHint};
@@ -131,6 +132,13 @@ where
131132
}
132133
}
133134

135+
impl<I> FusedIterator for Permutations<I>
136+
where
137+
I: Iterator,
138+
I::Item: Clone,
139+
{
140+
}
141+
134142
fn advance(indices: &mut [usize], cycles: &mut [usize]) -> bool {
135143
let n = indices.len();
136144
let k = cycles.len();

0 commit comments

Comments
 (0)