Skip to content

Commit

Permalink
Remove OrderingOrBool::Out
Browse files Browse the repository at this point in the history
Apparently not needed anymore.
  • Loading branch information
Philippe-Cholet authored and jswrenn committed Sep 20, 2023
1 parent 506264e commit 6ffdac1
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions src/merge_join.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ impl<L, R, T, F: FnMut(&L, &R) -> T> FuncLR<L, R> for F {
}

pub trait OrderingOrBool<L, R> {
type Out;
type MergeResult;
fn left(left: L) -> Self::MergeResult;
fn right(right: R) -> Self::MergeResult;
Expand All @@ -121,7 +120,6 @@ pub trait OrderingOrBool<L, R> {
}

impl<L, R, F: FnMut(&L, &R) -> Ordering> OrderingOrBool<L, R> for MergeFuncLR<F, Ordering> {
type Out = Ordering;
type MergeResult = EitherOrBoth<L, R>;
fn left(left: L) -> Self::MergeResult {
EitherOrBoth::Left(left)
Expand Down Expand Up @@ -149,7 +147,6 @@ impl<L, R, F: FnMut(&L, &R) -> Ordering> OrderingOrBool<L, R> for MergeFuncLR<F,
}

impl<L, R, F: FnMut(&L, &R) -> bool> OrderingOrBool<L, R> for MergeFuncLR<F, bool> {
type Out = bool;
type MergeResult = Either<L, R>;
fn left(left: L) -> Self::MergeResult {
Either::Left(left)
Expand All @@ -171,7 +168,6 @@ impl<L, R, F: FnMut(&L, &R) -> bool> OrderingOrBool<L, R> for MergeFuncLR<F, boo
}

impl<T, F: FnMut(&T, &T) -> bool> OrderingOrBool<T, T> for F {
type Out = bool;
type MergeResult = T;
fn left(left: T) -> Self::MergeResult {
left
Expand All @@ -193,7 +189,6 @@ impl<T, F: FnMut(&T, &T) -> bool> OrderingOrBool<T, T> for F {
}

impl<T: PartialOrd> OrderingOrBool<T, T> for MergeLte {
type Out = bool;
type MergeResult = T;
fn left(left: T) -> Self::MergeResult {
left
Expand Down Expand Up @@ -235,11 +230,11 @@ where
debug_fmt_fields!(MergeBy, left, right);
}

impl<I, J, F, T> Iterator for MergeBy<I, J, F>
impl<I, J, F> Iterator for MergeBy<I, J, F>
where
I: Iterator,
J: Iterator,
F: OrderingOrBool<I::Item, J::Item, Out = T>,
F: OrderingOrBool<I::Item, J::Item>,
{
type Item = F::MergeResult;

Expand Down Expand Up @@ -335,10 +330,10 @@ where
}
}

impl<I, J, F, T> FusedIterator for MergeBy<I, J, F>
impl<I, J, F> FusedIterator for MergeBy<I, J, F>
where
I: Iterator,
J: Iterator,
F: OrderingOrBool<I::Item, J::Item, Out = T>,
F: OrderingOrBool<I::Item, J::Item>,
{
}

0 comments on commit 6ffdac1

Please sign in to comment.