Skip to content

Commit

Permalink
impl FusedIterator for Permutations
Browse files Browse the repository at this point in the history
  • Loading branch information
Philippe-Cholet committed Nov 1, 2023
1 parent 8f0d0ae commit 8ab3995
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/permutations.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use alloc::vec::Vec;
use std::fmt;
use std::iter::once;
use std::iter::FusedIterator;

use super::lazy_buffer::LazyBuffer;
use crate::size_hint::{self, SizeHint};
Expand Down Expand Up @@ -131,6 +132,13 @@ where
}
}

impl<I> FusedIterator for Permutations<I>
where
I: Iterator,
I::Item: Clone,
{
}

fn advance(indices: &mut [usize], cycles: &mut [usize]) -> bool {
let n = indices.len();
let k = cycles.len();
Expand Down

0 comments on commit 8ab3995

Please sign in to comment.