Skip to content

Commit

Permalink
Fuse iterators in InterleaveShortest
Browse files Browse the repository at this point in the history
This brings InterleaveShortest in line with Interleave.
The documentation already (incorrectly) stated that InterleaveShortest is fused.
  • Loading branch information
phimuemue committed Feb 8, 2024
1 parent d5709c7 commit d8f7f59
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions src/adaptors/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,8 @@ where
I: Iterator,
J: Iterator<Item = I::Item>,
{
i: I,
j: J,
i: Fuse<I>,
j: Fuse<J>,
next_coming_from_j: bool,
}

Expand All @@ -139,8 +139,8 @@ where
J: Iterator<Item = I::Item>,
{
InterleaveShortest {
i,
j,
i: i.fuse(),
j: j.fuse(),
next_coming_from_j: false,
}
}
Expand Down Expand Up @@ -231,8 +231,8 @@ where

impl<I, J> FusedIterator for InterleaveShortest<I, J>
where
I: FusedIterator,
J: FusedIterator<Item = I::Item>,
I: Iterator,
J: Iterator<Item = I::Item>,
{
}

Expand Down
2 changes: 1 addition & 1 deletion tests/quick.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1880,7 +1880,7 @@ quickcheck! {

fn fused_interleave_shortest(a: Iter<i16>, b: Iter<i16>) -> bool
{
!is_fused(a.clone().interleave_shortest(b.clone())) &&
is_fused(a.clone().interleave_shortest(b.clone())) &&
is_fused(a.fuse().interleave_shortest(b.fuse()))
}

Expand Down

0 comments on commit d8f7f59

Please sign in to comment.