Skip to content

Commit

Permalink
Implement FusedIterator for MergeJoinBy
Browse files Browse the repository at this point in the history
  • Loading branch information
Philippe-Cholet committed Jun 21, 2023
1 parent 6b8750c commit 6f04424
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/merge_join.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use std::cmp::Ordering;
use std::iter::Fuse;
// use std::iter::FusedIterator;
use std::iter::{Fuse, FusedIterator};
use std::fmt;
use std::marker::PhantomData;

Expand Down Expand Up @@ -79,12 +78,6 @@ pub fn merge_by_new<I, J, F>(a: I, b: J, cmp: F) -> MergeBy<I::IntoIter, J::Into
}
}

// impl<I, J, F> FusedIterator for MergeBy<I, J, F>
// where I: FusedIterator,
// J: FusedIterator<Item = I::Item>,
// F: FnMut(&I::Item, &I::Item) -> bool,
// {}

/// Return an iterator adaptor that merge-joins items from the two base iterators in ascending order.
///
/// [`IntoIterator`] enabled version of [`Itertools::merge_join_by`].
Expand Down Expand Up @@ -338,3 +331,9 @@ impl<I, J, F, T> Iterator for MergeJoinBy<I, J, F>
}
}
}

impl<I, J, F, T> FusedIterator for MergeJoinBy<I, J, F>
where I: FusedIterator,
J: FusedIterator,
F: MergePredicate<I::Item, J::Item, Out = T>,
{}

0 comments on commit 6f04424

Please sign in to comment.