| 1 | use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::cmprust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/::Orderingrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Ordering#; |
| 2 | use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::fmtrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc fmt/; |
| 3 | use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::iterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/::{Fuserust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/adapters/fuse/Fuse#, FusedIteratorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/marker/FusedIterator#}; |
| 4 | use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::markerrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/::PhantomDatarust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/PhantomData#; |
| 5 | |
| 6 | use eitherrust-analyzer cargo either 1.15.0 crate/::Eitherrust-analyzer cargo either 1.15.0 Either#; |
| 7 | |
| 8 | use superrust-analyzer cargo itertools 0.14.0 crate/::adaptorsrust-analyzer cargo itertools 0.14.0 adaptors/::{put_backrust-analyzer cargo itertools 0.14.0 adaptors/put_back()., PutBackrust-analyzer cargo itertools 0.14.0 adaptors/PutBack#}; |
| 9 | use craterust-analyzer cargo itertools 0.14.0 crate/::either_or_bothrust-analyzer cargo itertools 0.14.0 either_or_both/::EitherOrBothrust-analyzer cargo itertools 0.14.0 either_or_both/EitherOrBoth#; |
| 10 | use craterust-analyzer cargo itertools 0.14.0 crate/::size_hintrust-analyzer cargo itertools 0.14.0 size_hint/::{selfrust-analyzer cargo itertools 0.14.0 size_hint/, SizeHintrust-analyzer cargo itertools 0.14.0 size_hint/SizeHint#}; |
| 11 | #[cfg(doc)] |
| 12 | use craterust-analyzer cargo itertools 0.14.0 crate/::Itertoolsrust-analyzer cargo itertools 0.14.0 Itertools#; |
| 13 | |
| 14 | #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:, Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:)] |
| 15 | pub struct MergeLterust-analyzer cargo itertools 0.14.0 merge_join/MergeLte#; |
| 16 | |
| 17 | /// An iterator adaptor that merges the two base iterators in ascending order. |
| 18 | /// If both base iterators are sorted (ascending), the result is sorted. |
| 19 | /// |
| 20 | /// Iterator element type is `I::Item`. |
| 21 | /// |
| 22 | /// See [`.merge()`](crate::Itertools::merge_by) for more information. |
| 23 | pub type Mergerust-analyzer cargo itertools 0.14.0 merge_join/Merge#<I, J> = MergeByrust-analyzer cargo itertools 0.14.0 merge_join/MergeBy#<I, J, MergeLterust-analyzer cargo itertools 0.14.0 merge_join/MergeLte#>; |
| 24 | |
| 25 | /// Create an iterator that merges elements in `i` and `j`. |
| 26 | /// |
| 27 | /// [`IntoIterator`] enabled version of [`Itertools::merge`](crate::Itertools::merge). |
| 28 | /// |
| 29 | /// ``` |
| 30 | /// use itertools::merge; |
| 31 | /// |
| 32 | /// for elt in merge(&[1, 2, 3], &[2, 3, 4]) { |
| 33 | /// /* loop body */ |
| 34 | /// # let _ = elt; |
| 35 | /// } |
| 36 | /// ``` |
| 37 | pub fn mergerust-analyzer cargo itertools 0.14.0 merge_join/merge().<I, J>( |
| 38 | i: I, |
| 39 | j: J, |
| 40 | ) -> Mergerust-analyzer cargo itertools 0.14.0 merge_join/Merge#<<I as IntoIteratorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/collect/IntoIterator#>::IntoIterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/collect/IntoIterator#IntoIter#, <J as IntoIteratorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/collect/IntoIterator#>::IntoIterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/collect/IntoIterator#IntoIter#> |
| 41 | where |
| 42 | I: IntoIteratorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/collect/IntoIterator#, |
| 43 | J: IntoIteratorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/collect/IntoIterator#<Itemrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/collect/IntoIterator#Item# = I::Itemrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/collect/IntoIterator#Item#>, |
| 44 | I::Itemrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/collect/IntoIterator#Item#: PartialOrdrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialOrd#, |
| 45 | { |
| 46 | merge_by_newrust-analyzer cargo itertools 0.14.0 merge_join/merge_by_new().(i, j, MergeLterust-analyzer cargo itertools 0.14.0 merge_join/MergeLte#) |
| 47 | } |
| 48 | |
| 49 | /// An iterator adaptor that merges the two base iterators in ascending order. |
| 50 | /// If both base iterators are sorted (ascending), the result is sorted. |
| 51 | /// |
| 52 | /// Iterator element type is `I::Item`. |
| 53 | /// |
| 54 | /// See [`.merge_by()`](crate::Itertools::merge_by) for more information. |
| 55 | #[must_use = "iterator adaptors are lazy and do nothing unless consumed"] |
| 56 | pub struct MergeByrust-analyzer cargo itertools 0.14.0 merge_join/MergeBy#<I: Iteratorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#, J: Iteratorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#, F> { |
| 57 | leftrust-analyzer cargo itertools 0.14.0 merge_join/MergeBy#left.: PutBackrust-analyzer cargo itertools 0.14.0 adaptors/PutBack#<Fuserust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/adapters/fuse/Fuse#<I>>, |
| 58 | rightrust-analyzer cargo itertools 0.14.0 merge_join/MergeBy#right.: PutBackrust-analyzer cargo itertools 0.14.0 adaptors/PutBack#<Fuserust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/adapters/fuse/Fuse#<J>>, |
| 59 | cmp_fnrust-analyzer cargo itertools 0.14.0 merge_join/MergeBy#cmp_fn.: F, |
| 60 | } |
| 61 | |
| 62 | /// Create a `MergeBy` iterator. |
| 63 | pub fn merge_by_newrust-analyzer cargo itertools 0.14.0 merge_join/merge_by_new().<I, J, F>(a: I, b: J, cmp: F) -> MergeByrust-analyzer cargo itertools 0.14.0 merge_join/MergeBy#<I::IntoIterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/collect/IntoIterator#IntoIter#, J::IntoIterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/collect/IntoIterator#IntoIter#, F> |
| 64 | where |
| 65 | I: IntoIteratorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/collect/IntoIterator#, |
| 66 | J: IntoIteratorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/collect/IntoIterator#<Itemrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/collect/IntoIterator#Item# = I::Itemrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/collect/IntoIterator#Item#>, |
| 67 | { |
| 68 | MergeByrust-analyzer cargo itertools 0.14.0 merge_join/MergeBy# { |
| 69 | leftrust-analyzer cargo itertools 0.14.0 merge_join/MergeBy#left.: put_backrust-analyzer cargo itertools 0.14.0 adaptors/put_back().(a.into_iterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/collect/IntoIterator#into_iter().().fuserust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#fuse().()), |
| 70 | rightrust-analyzer cargo itertools 0.14.0 merge_join/MergeBy#right.: put_backrust-analyzer cargo itertools 0.14.0 adaptors/put_back().(b.into_iterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/collect/IntoIterator#into_iter().().fuserust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#fuse().()), |
| 71 | cmp_fnrust-analyzer cargo itertools 0.14.0 merge_join/MergeBy#cmp_fn.: cmp, |
| 72 | } |
| 73 | } |
| 74 | |
| 75 | /// Return an iterator adaptor that merge-joins items from the two base iterators in ascending order. |
| 76 | /// |
| 77 | /// [`IntoIterator`] enabled version of [`Itertools::merge_join_by`]. |
| 78 | pub fn merge_join_byrust-analyzer cargo itertools 0.14.0 merge_join/merge_join_by().<I, J, F, T>( |
| 79 | left: I, |
| 80 | right: J, |
| 81 | cmp_fn: F, |
| 82 | ) -> MergeJoinByrust-analyzer cargo itertools 0.14.0 merge_join/MergeJoinBy#<I::IntoIterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/collect/IntoIterator#IntoIter#, J::IntoIterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/collect/IntoIterator#IntoIter#, F> |
| 83 | where |
| 84 | I: IntoIteratorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/collect/IntoIterator#, |
| 85 | J: IntoIteratorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/collect/IntoIterator#, |
| 86 | F: FnMutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/function/FnMut#(&I::Itemrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/collect/IntoIterator#Item#, &J::Itemrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/collect/IntoIterator#Item#) -> T, |
| 87 | { |
| 88 | MergeByrust-analyzer cargo itertools 0.14.0 merge_join/MergeBy# { |
| 89 | leftrust-analyzer cargo itertools 0.14.0 merge_join/MergeBy#left.: put_backrust-analyzer cargo itertools 0.14.0 adaptors/put_back().(left.into_iterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/collect/IntoIterator#into_iter().().fuserust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#fuse().()), |
| 90 | rightrust-analyzer cargo itertools 0.14.0 merge_join/MergeBy#right.: put_backrust-analyzer cargo itertools 0.14.0 adaptors/put_back().(right.into_iterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/collect/IntoIterator#into_iter().().fuserust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#fuse().()), |
| 91 | cmp_fnrust-analyzer cargo itertools 0.14.0 merge_join/MergeBy#cmp_fn.: MergeFuncLRrust-analyzer cargo itertools 0.14.0 merge_join/MergeFuncLR#(cmp_fn, PhantomDatarust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/PhantomData#), |
| 92 | } |
| 93 | } |
| 94 | |
| 95 | /// An iterator adaptor that merge-joins items from the two base iterators in ascending order. |
| 96 | /// |
| 97 | /// See [`.merge_join_by()`](crate::Itertools::merge_join_by) for more information. |
| 98 | pub type MergeJoinByrust-analyzer cargo itertools 0.14.0 merge_join/MergeJoinBy#<I, J, F> = |
| 99 | MergeByrust-analyzer cargo itertools 0.14.0 merge_join/MergeBy#<I, J, MergeFuncLRrust-analyzer cargo itertools 0.14.0 merge_join/MergeFuncLR#<F, <F as FuncLRrust-analyzer cargo itertools 0.14.0 merge_join/FuncLR#<<I as Iteratorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#>::Itemrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#Item#, <J as Iteratorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#>::Itemrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#Item#>>::Trust-analyzer cargo itertools 0.14.0 merge_join/FuncLR#T#>>; |
| 100 | |
| 101 | #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:, Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:)] |
| 102 | pub struct MergeFuncLRrust-analyzer cargo itertools 0.14.0 merge_join/MergeFuncLR#<F, T>(F, PhantomDatarust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/PhantomData#<T>); |
| 103 | |
| 104 | pub trait FuncLRrust-analyzer cargo itertools 0.14.0 merge_join/FuncLR#<L, R> { |
| 105 | type Trust-analyzer cargo itertools 0.14.0 merge_join/FuncLR#T#; |
| 106 | } |
| 107 | |
| 108 | impl<L, R, T, F: FnMutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/function/FnMut#(&L, &R) -> T> FuncLRrust-analyzer cargo itertools 0.14.0 merge_join/FuncLR#<L, R> for F { |
| 109 | type Trust-analyzer cargo itertools 0.14.0 merge_join/impl#[F][`FuncLR<L, R>`]T# = T; |
| 110 | } |
| 111 | |
| 112 | pub trait OrderingOrBoolrust-analyzer cargo itertools 0.14.0 merge_join/OrderingOrBool#<L, R> { |
| 113 | type MergeResultrust-analyzer cargo itertools 0.14.0 merge_join/OrderingOrBool#MergeResult#; |
| 114 | fn leftrust-analyzer cargo itertools 0.14.0 merge_join/OrderingOrBool#left().(left: L) -> Self::MergeResultrust-analyzer cargo itertools 0.14.0 merge_join/OrderingOrBool#MergeResult#; |
| 115 | fn rightrust-analyzer cargo itertools 0.14.0 merge_join/OrderingOrBool#right().(right: R) -> Self::MergeResultrust-analyzer cargo itertools 0.14.0 merge_join/OrderingOrBool#MergeResult#; |
| 116 | // "merge" never returns (Some(...), Some(...), ...) so Option<Either<I::Item, J::Item>> |
| 117 | // is appealing but it is always followed by two put_backs, so we think the compiler is |
| 118 | // smart enough to optimize it. Or we could move put_backs into "merge". |
| 119 | fn mergerust-analyzer cargo itertools 0.14.0 merge_join/OrderingOrBool#merge().(&mut self, left: L, right: R) -> (Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Eitherrust-analyzer cargo either 1.15.0 Either#<L, R>>, Self::MergeResultrust-analyzer cargo itertools 0.14.0 merge_join/OrderingOrBool#MergeResult#); |
| 120 | fn size_hintrust-analyzer cargo itertools 0.14.0 merge_join/OrderingOrBool#size_hint().(left: SizeHintrust-analyzer cargo itertools 0.14.0 size_hint/SizeHint#, right: SizeHintrust-analyzer cargo itertools 0.14.0 size_hint/SizeHint#) -> SizeHintrust-analyzer cargo itertools 0.14.0 size_hint/SizeHint#; |
| 121 | } |
| 122 | |
| 123 | impl<L, R, F: FnMutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/function/FnMut#(&L, &R) -> Orderingrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Ordering#> OrderingOrBoolrust-analyzer cargo itertools 0.14.0 merge_join/OrderingOrBool#<L, R> for MergeFuncLRrust-analyzer cargo itertools 0.14.0 merge_join/MergeFuncLR#<F, Orderingrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Ordering#> { |
| 124 | type MergeResultrust-analyzer cargo itertools 0.14.0 merge_join/impl#[`MergeFuncLR<F, Ordering>`][`OrderingOrBool<L, R>`]MergeResult# = EitherOrBothrust-analyzer cargo itertools 0.14.0 either_or_both/EitherOrBoth#<L, R>; |
| 125 | fn leftrust-analyzer cargo itertools 0.14.0 merge_join/impl#[`MergeFuncLR<F, Ordering>`][`OrderingOrBool<L, R>`]left().(left: L) -> Selfrust-analyzer cargo itertools 0.14.0 merge_join/impl#[`MergeFuncLR<F, Ordering>`][`OrderingOrBool<L, R>`]::MergeResultrust-analyzer cargo itertools 0.14.0 merge_join/OrderingOrBool#MergeResult# { |
| 126 | EitherOrBothrust-analyzer cargo itertools 0.14.0 either_or_both/EitherOrBoth#::Leftrust-analyzer cargo itertools 0.14.0 either_or_both/EitherOrBoth#Left#(left) |
| 127 | } |
| 128 | fn rightrust-analyzer cargo itertools 0.14.0 merge_join/impl#[`MergeFuncLR<F, Ordering>`][`OrderingOrBool<L, R>`]right().(right: R) -> Selfrust-analyzer cargo itertools 0.14.0 merge_join/impl#[`MergeFuncLR<F, Ordering>`][`OrderingOrBool<L, R>`]::MergeResultrust-analyzer cargo itertools 0.14.0 merge_join/OrderingOrBool#MergeResult# { |
| 129 | EitherOrBothrust-analyzer cargo itertools 0.14.0 either_or_both/EitherOrBoth#::Rightrust-analyzer cargo itertools 0.14.0 either_or_both/EitherOrBoth#Right#(right) |
| 130 | } |
| 131 | fn mergerust-analyzer cargo itertools 0.14.0 merge_join/impl#[`MergeFuncLR<F, Ordering>`][`OrderingOrBool<L, R>`]merge().(&mut self, left: L, right: R) -> (Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Eitherrust-analyzer cargo either 1.15.0 Either#<L, R>>, Selfrust-analyzer cargo itertools 0.14.0 merge_join/impl#[`MergeFuncLR<F, Ordering>`][`OrderingOrBool<L, R>`]::MergeResultrust-analyzer cargo itertools 0.14.0 merge_join/OrderingOrBool#MergeResult#) { |
| 132 | match self.0rust-analyzer cargo itertools 0.14.0 merge_join/MergeFuncLR#0.(&left, &right) { |
| 133 | Orderingrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Ordering#::Equalrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Ordering#Equal# => (Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#, EitherOrBothrust-analyzer cargo itertools 0.14.0 either_or_both/EitherOrBoth#::Bothrust-analyzer cargo itertools 0.14.0 either_or_both/EitherOrBoth#Both#(left, right)), |
| 134 | Orderingrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Ordering#::Lessrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Ordering#Less# => (Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(Eitherrust-analyzer cargo either 1.15.0 Either#::Rightrust-analyzer cargo either 1.15.0 Either#Right#(right)), EitherOrBothrust-analyzer cargo itertools 0.14.0 either_or_both/EitherOrBoth#::Leftrust-analyzer cargo itertools 0.14.0 either_or_both/EitherOrBoth#Left#(left)), |
| 135 | Orderingrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Ordering#::Greaterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Ordering#Greater# => (Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(Eitherrust-analyzer cargo either 1.15.0 Either#::Leftrust-analyzer cargo either 1.15.0 Either#Left#(left)), EitherOrBothrust-analyzer cargo itertools 0.14.0 either_or_both/EitherOrBoth#::Rightrust-analyzer cargo itertools 0.14.0 either_or_both/EitherOrBoth#Right#(right)), |
| 136 | } |
| 137 | } |
| 138 | fn size_hintrust-analyzer cargo itertools 0.14.0 merge_join/impl#[`MergeFuncLR<F, Ordering>`][`OrderingOrBool<L, R>`]size_hint().(left: SizeHintrust-analyzer cargo itertools 0.14.0 size_hint/SizeHint#, right: SizeHintrust-analyzer cargo itertools 0.14.0 size_hint/SizeHint#) -> SizeHintrust-analyzer cargo itertools 0.14.0 size_hint/SizeHint# { |
| 139 | let (a_lower, a_upper) = left; |
| 140 | let (b_lower, b_upper) = right; |
| 141 | let lower = ::stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::cmprust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/::maxrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/max().(a_lower, b_lower); |
| 142 | let upper = match (a_upper, b_upper) { |
| 143 | (Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(x), Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(y)) => x.checked_addrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[usize]checked_add().(y), |
| 144 | _ => Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#, |
| 145 | }; |
| 146 | (lower, upper) |
| 147 | } |
| 148 | } |
| 149 | |
| 150 | impl<L, R, F: FnMutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/function/FnMut#(&L, &R) -> bool> OrderingOrBoolrust-analyzer cargo itertools 0.14.0 merge_join/OrderingOrBool#<L, R> for MergeFuncLRrust-analyzer cargo itertools 0.14.0 merge_join/MergeFuncLR#<F, bool> { |
| 151 | type MergeResultrust-analyzer cargo itertools 0.14.0 merge_join/impl#[`MergeFuncLR<F, bool>`][`OrderingOrBool<L, R>`]MergeResult# = Eitherrust-analyzer cargo either 1.15.0 Either#<L, R>; |
| 152 | fn leftrust-analyzer cargo itertools 0.14.0 merge_join/impl#[`MergeFuncLR<F, bool>`][`OrderingOrBool<L, R>`]left().(left: L) -> Selfrust-analyzer cargo itertools 0.14.0 merge_join/impl#[`MergeFuncLR<F, bool>`][`OrderingOrBool<L, R>`]::MergeResultrust-analyzer cargo itertools 0.14.0 merge_join/OrderingOrBool#MergeResult# { |
| 153 | Eitherrust-analyzer cargo either 1.15.0 Either#::Leftrust-analyzer cargo either 1.15.0 Either#Left#(left) |
| 154 | } |
| 155 | fn rightrust-analyzer cargo itertools 0.14.0 merge_join/impl#[`MergeFuncLR<F, bool>`][`OrderingOrBool<L, R>`]right().(right: R) -> Selfrust-analyzer cargo itertools 0.14.0 merge_join/impl#[`MergeFuncLR<F, bool>`][`OrderingOrBool<L, R>`]::MergeResultrust-analyzer cargo itertools 0.14.0 merge_join/OrderingOrBool#MergeResult# { |
| 156 | Eitherrust-analyzer cargo either 1.15.0 Either#::Rightrust-analyzer cargo either 1.15.0 Either#Right#(right) |
| 157 | } |
| 158 | fn mergerust-analyzer cargo itertools 0.14.0 merge_join/impl#[`MergeFuncLR<F, bool>`][`OrderingOrBool<L, R>`]merge().(&mut self, left: L, right: R) -> (Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Eitherrust-analyzer cargo either 1.15.0 Either#<L, R>>, Selfrust-analyzer cargo itertools 0.14.0 merge_join/impl#[`MergeFuncLR<F, bool>`][`OrderingOrBool<L, R>`]::MergeResultrust-analyzer cargo itertools 0.14.0 merge_join/OrderingOrBool#MergeResult#) { |
| 159 | if self.0rust-analyzer cargo itertools 0.14.0 merge_join/MergeFuncLR#0.(&left, &right) { |
| 160 | (Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(Eitherrust-analyzer cargo either 1.15.0 Either#::Rightrust-analyzer cargo either 1.15.0 Either#Right#(right)), Eitherrust-analyzer cargo either 1.15.0 Either#::Leftrust-analyzer cargo either 1.15.0 Either#Left#(left)) |
| 161 | } else { |
| 162 | (Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(Eitherrust-analyzer cargo either 1.15.0 Either#::Leftrust-analyzer cargo either 1.15.0 Either#Left#(left)), Eitherrust-analyzer cargo either 1.15.0 Either#::Rightrust-analyzer cargo either 1.15.0 Either#Right#(right)) |
| 163 | } |
| 164 | } |
| 165 | fn size_hintrust-analyzer cargo itertools 0.14.0 merge_join/impl#[`MergeFuncLR<F, bool>`][`OrderingOrBool<L, R>`]size_hint().(left: SizeHintrust-analyzer cargo itertools 0.14.0 size_hint/SizeHint#, right: SizeHintrust-analyzer cargo itertools 0.14.0 size_hint/SizeHint#) -> SizeHintrust-analyzer cargo itertools 0.14.0 size_hint/SizeHint# { |
| 166 | // Not ExactSizeIterator because size may be larger than usize |
| 167 | size_hintrust-analyzer cargo itertools 0.14.0 size_hint/::addrust-analyzer cargo itertools 0.14.0 size_hint/add().(left, right) |
| 168 | } |
| 169 | } |
| 170 | |
| 171 | impl<T, F: FnMutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/function/FnMut#(&T, &T) -> bool> OrderingOrBoolrust-analyzer cargo itertools 0.14.0 merge_join/OrderingOrBool#<T, T> for F { |
| 172 | type MergeResultrust-analyzer cargo itertools 0.14.0 merge_join/impl#[F][`OrderingOrBool<T, T>`]MergeResult# = T; |
| 173 | fn leftrust-analyzer cargo itertools 0.14.0 merge_join/impl#[F][`OrderingOrBool<T, T>`]left().(left: T) -> Selfrust-analyzer cargo itertools 0.14.0 merge_join/impl#[F][`OrderingOrBool<T, T>`]::MergeResultrust-analyzer cargo itertools 0.14.0 merge_join/OrderingOrBool#MergeResult# { |
| 174 | left |
| 175 | } |
| 176 | fn rightrust-analyzer cargo itertools 0.14.0 merge_join/impl#[F][`OrderingOrBool<T, T>`]right().(right: T) -> Selfrust-analyzer cargo itertools 0.14.0 merge_join/impl#[F][`OrderingOrBool<T, T>`]::MergeResultrust-analyzer cargo itertools 0.14.0 merge_join/OrderingOrBool#MergeResult# { |
| 177 | right |
| 178 | } |
| 179 | fn mergerust-analyzer cargo itertools 0.14.0 merge_join/impl#[F][`OrderingOrBool<T, T>`]merge().(&mut self, left: T, right: T) -> (Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Eitherrust-analyzer cargo either 1.15.0 Either#<T, T>>, Selfrust-analyzer cargo itertools 0.14.0 merge_join/impl#[F][`OrderingOrBool<T, T>`]::MergeResultrust-analyzer cargo itertools 0.14.0 merge_join/OrderingOrBool#MergeResult#) { |
| 180 | if self(&left, &right) { |
| 181 | (Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(Eitherrust-analyzer cargo either 1.15.0 Either#::Rightrust-analyzer cargo either 1.15.0 Either#Right#(right)), left) |
| 182 | } else { |
| 183 | (Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(Eitherrust-analyzer cargo either 1.15.0 Either#::Leftrust-analyzer cargo either 1.15.0 Either#Left#(left)), right) |
| 184 | } |
| 185 | } |
| 186 | fn size_hintrust-analyzer cargo itertools 0.14.0 merge_join/impl#[F][`OrderingOrBool<T, T>`]size_hint().(left: SizeHintrust-analyzer cargo itertools 0.14.0 size_hint/SizeHint#, right: SizeHintrust-analyzer cargo itertools 0.14.0 size_hint/SizeHint#) -> SizeHintrust-analyzer cargo itertools 0.14.0 size_hint/SizeHint# { |
| 187 | // Not ExactSizeIterator because size may be larger than usize |
| 188 | size_hintrust-analyzer cargo itertools 0.14.0 size_hint/::addrust-analyzer cargo itertools 0.14.0 size_hint/add().(left, right) |
| 189 | } |
| 190 | } |
| 191 | |
| 192 | impl<T: PartialOrdrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialOrd#> OrderingOrBoolrust-analyzer cargo itertools 0.14.0 merge_join/OrderingOrBool#<T, T> for MergeLterust-analyzer cargo itertools 0.14.0 merge_join/MergeLte# { |
| 193 | type MergeResultrust-analyzer cargo itertools 0.14.0 merge_join/impl#[MergeLte][`OrderingOrBool<T, T>`]MergeResult# = T; |
| 194 | fn leftrust-analyzer cargo itertools 0.14.0 merge_join/impl#[MergeLte][`OrderingOrBool<T, T>`]left().(left: T) -> Selfrust-analyzer cargo itertools 0.14.0 merge_join/impl#[MergeLte][`OrderingOrBool<T, T>`]::MergeResultrust-analyzer cargo itertools 0.14.0 merge_join/OrderingOrBool#MergeResult# { |
| 195 | left |
| 196 | } |
| 197 | fn rightrust-analyzer cargo itertools 0.14.0 merge_join/impl#[MergeLte][`OrderingOrBool<T, T>`]right().(right: T) -> Selfrust-analyzer cargo itertools 0.14.0 merge_join/impl#[MergeLte][`OrderingOrBool<T, T>`]::MergeResultrust-analyzer cargo itertools 0.14.0 merge_join/OrderingOrBool#MergeResult# { |
| 198 | right |
| 199 | } |
| 200 | fn mergerust-analyzer cargo itertools 0.14.0 merge_join/impl#[MergeLte][`OrderingOrBool<T, T>`]merge().(&mut self, left: T, right: T) -> (Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Eitherrust-analyzer cargo either 1.15.0 Either#<T, T>>, Selfrust-analyzer cargo itertools 0.14.0 merge_join/impl#[MergeLte][`OrderingOrBool<T, T>`]::MergeResultrust-analyzer cargo itertools 0.14.0 merge_join/OrderingOrBool#MergeResult#) { |
| 201 | if left rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialOrd#le().<=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialOrd#le(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialOrd#le().right { |
| 202 | (Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(Eitherrust-analyzer cargo either 1.15.0 Either#::Rightrust-analyzer cargo either 1.15.0 Either#Right#(right)), left) |
| 203 | } else { |
| 204 | (Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(Eitherrust-analyzer cargo either 1.15.0 Either#::Leftrust-analyzer cargo either 1.15.0 Either#Left#(left)), right) |
| 205 | } |
| 206 | } |
| 207 | fn size_hintrust-analyzer cargo itertools 0.14.0 merge_join/impl#[MergeLte][`OrderingOrBool<T, T>`]size_hint().(left: SizeHintrust-analyzer cargo itertools 0.14.0 size_hint/SizeHint#, right: SizeHintrust-analyzer cargo itertools 0.14.0 size_hint/SizeHint#) -> SizeHintrust-analyzer cargo itertools 0.14.0 size_hint/SizeHint# { |
| 208 | // Not ExactSizeIterator because size may be larger than usize |
| 209 | size_hintrust-analyzer cargo itertools 0.14.0 size_hint/::addrust-analyzer cargo itertools 0.14.0 size_hint/add().(left, right) |
| 210 | } |
| 211 | } |
| 212 | |
| 213 | impl<I, J, F> Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone# for MergeByrust-analyzer cargo itertools 0.14.0 merge_join/MergeBy#<I, J, F> |
| 214 | where |
| 215 | I: Iteratorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#, |
| 216 | J: Iteratorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#, |
| 217 | PutBackrust-analyzer cargo itertools 0.14.0 adaptors/PutBack#<Fuserust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/adapters/fuse/Fuse#<I>>: Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone#, |
| 218 | PutBackrust-analyzer cargo itertools 0.14.0 adaptors/PutBack#<Fuserust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/adapters/fuse/Fuse#<J>>: Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone#, |
| 219 | F: Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone#, |
| 220 | { |
| 221 | clone_fieldsrust-analyzer cargo itertools 0.14.0 impl_macros/clone_fields!!(leftrust-analyzer cargo itertools 0.14.0 merge_join/MergeBy#left., rightrust-analyzer cargo itertools 0.14.0 merge_join/MergeBy#right., cmp_fnrust-analyzer cargo itertools 0.14.0 merge_join/MergeBy#cmp_fn.); |
| 222 | } |
| 223 | |
| 224 | impl<I, J, F> fmtrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc fmt/::Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Debug# for MergeByrust-analyzer cargo itertools 0.14.0 merge_join/MergeBy#<I, J, F> |
| 225 | where |
| 226 | I: Iteratorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator# + fmtrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc fmt/::Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Debug#, |
| 227 | I::Itemrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#Item#: fmtrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc fmt/::Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Debug#, |
| 228 | J: Iteratorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator# + fmtrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc fmt/::Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Debug#, |
| 229 | J::Itemrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#Item#: fmtrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc fmt/::Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Debug#, |
| 230 | { |
| 231 | debug_fmt_fieldsrust-analyzer cargo itertools 0.14.0 impl_macros/debug_fmt_fields!!(MergeBy, leftrust-analyzer cargo itertools 0.14.0 merge_join/MergeBy#left., rightrust-analyzer cargo itertools 0.14.0 merge_join/MergeBy#right.); |
| 232 | } |
| 233 | |
| 234 | impl<I, J, F> Iteratorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator# for MergeByrust-analyzer cargo itertools 0.14.0 merge_join/MergeBy#<I, J, F> |
| 235 | where |
| 236 | I: Iteratorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#, |
| 237 | J: Iteratorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#, |
| 238 | F: OrderingOrBoolrust-analyzer cargo itertools 0.14.0 merge_join/OrderingOrBool#<I::Itemrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#Item#, J::Itemrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#Item#>, |
| 239 | { |
| 240 | type Itemrust-analyzer cargo itertools 0.14.0 merge_join/impl#[`MergeBy<I, J, F>`][Iterator]Item# = F::MergeResultrust-analyzer cargo itertools 0.14.0 merge_join/OrderingOrBool#MergeResult#; |
| 241 | |
| 242 | fn nextrust-analyzer cargo itertools 0.14.0 merge_join/impl#[`MergeBy<I, J, F>`][Iterator]next().(&mut self) -> Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Selfrust-analyzer cargo itertools 0.14.0 merge_join/impl#[`MergeBy<I, J, F>`][Iterator]::Itemrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#Item#> { |
| 243 | match (self.leftrust-analyzer cargo itertools 0.14.0 merge_join/MergeBy#left..nextrust-analyzer cargo itertools 0.14.0 adaptors/impl#[`PutBack<I>`][Iterator]next().(), self.rightrust-analyzer cargo itertools 0.14.0 merge_join/MergeBy#right..nextrust-analyzer cargo itertools 0.14.0 adaptors/impl#[`PutBack<I>`][Iterator]next().()) { |
| 244 | (Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#, Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#) => Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#, |
| 245 | (Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(left), Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#) => Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(F::leftrust-analyzer cargo itertools 0.14.0 merge_join/OrderingOrBool#left().(left)), |
| 246 | (Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#, Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(right)) => Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(F::rightrust-analyzer cargo itertools 0.14.0 merge_join/OrderingOrBool#right().(right)), |
| 247 | (Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(left), Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(right)) => { |
| 248 | let (not_next, next) = self.cmp_fnrust-analyzer cargo itertools 0.14.0 merge_join/MergeBy#cmp_fn..mergerust-analyzer cargo itertools 0.14.0 merge_join/OrderingOrBool#merge().(left, right); |
| 249 | match not_next { |
| 250 | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(Eitherrust-analyzer cargo either 1.15.0 Either#::Leftrust-analyzer cargo either 1.15.0 Either#Left#(l)) => { |
| 251 | self.leftrust-analyzer cargo itertools 0.14.0 merge_join/MergeBy#left..put_backrust-analyzer cargo itertools 0.14.0 adaptors/impl#[`PutBack<I>`]put_back().(l); |
| 252 | } |
| 253 | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(Eitherrust-analyzer cargo either 1.15.0 Either#::Rightrust-analyzer cargo either 1.15.0 Either#Right#(r)) => { |
| 254 | self.rightrust-analyzer cargo itertools 0.14.0 merge_join/MergeBy#right..put_backrust-analyzer cargo itertools 0.14.0 adaptors/impl#[`PutBack<I>`]put_back().(r); |
| 255 | } |
| 256 | Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None# => (), |
| 257 | } |
| 258 | |
| 259 | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(next) |
| 260 | } |
| 261 | } |
| 262 | } |
| 263 | |
| 264 | fn foldrust-analyzer cargo itertools 0.14.0 merge_join/impl#[`MergeBy<I, J, F>`][Iterator]fold().<B, G>(mut self, init: B, mut f: G) -> B |
| 265 | where |
| 266 | Selfrust-analyzer cargo itertools 0.14.0 merge_join/impl#[`MergeBy<I, J, F>`][Iterator]: Sizedrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Sized#, |
| 267 | G: FnMutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/function/FnMut#(B, Selfrust-analyzer cargo itertools 0.14.0 merge_join/impl#[`MergeBy<I, J, F>`][Iterator]::Itemrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#Item#) -> B, |
| 268 | { |
| 269 | let mut acc = init; |
| 270 | let mut left = self.leftrust-analyzer cargo itertools 0.14.0 merge_join/MergeBy#left..nextrust-analyzer cargo itertools 0.14.0 adaptors/impl#[`PutBack<I>`][Iterator]next().(); |
| 271 | let mut right = self.rightrust-analyzer cargo itertools 0.14.0 merge_join/MergeBy#right..nextrust-analyzer cargo itertools 0.14.0 adaptors/impl#[`PutBack<I>`][Iterator]next().(); |
| 272 | |
| 273 | loop { |
| 274 | match (left, right) { |
| 275 | (Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(l), Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(r)) => match self.cmp_fnrust-analyzer cargo itertools 0.14.0 merge_join/MergeBy#cmp_fn..mergerust-analyzer cargo itertools 0.14.0 merge_join/OrderingOrBool#merge().(l, r) { |
| 276 | (Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(Eitherrust-analyzer cargo either 1.15.0 Either#::Rightrust-analyzer cargo either 1.15.0 Either#Right#(r)), x) => { |
| 277 | acc = f(acc, x); |
| 278 | left = self.leftrust-analyzer cargo itertools 0.14.0 merge_join/MergeBy#left..nextrust-analyzer cargo itertools 0.14.0 adaptors/impl#[`PutBack<I>`][Iterator]next().(); |
| 279 | right = Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(r); |
| 280 | } |
| 281 | (Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(Eitherrust-analyzer cargo either 1.15.0 Either#::Leftrust-analyzer cargo either 1.15.0 Either#Left#(l)), x) => { |
| 282 | acc = f(acc, x); |
| 283 | left = Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(l); |
| 284 | right = self.rightrust-analyzer cargo itertools 0.14.0 merge_join/MergeBy#right..nextrust-analyzer cargo itertools 0.14.0 adaptors/impl#[`PutBack<I>`][Iterator]next().(); |
| 285 | } |
| 286 | (Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#, x) => { |
| 287 | acc = f(acc, x); |
| 288 | left = self.leftrust-analyzer cargo itertools 0.14.0 merge_join/MergeBy#left..nextrust-analyzer cargo itertools 0.14.0 adaptors/impl#[`PutBack<I>`][Iterator]next().(); |
| 289 | right = self.rightrust-analyzer cargo itertools 0.14.0 merge_join/MergeBy#right..nextrust-analyzer cargo itertools 0.14.0 adaptors/impl#[`PutBack<I>`][Iterator]next().(); |
| 290 | } |
| 291 | }, |
| 292 | (Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(l), Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#) => { |
| 293 | self.leftrust-analyzer cargo itertools 0.14.0 merge_join/MergeBy#left..put_backrust-analyzer cargo itertools 0.14.0 adaptors/impl#[`PutBack<I>`]put_back().(l); |
| 294 | acc = self.leftrust-analyzer cargo itertools 0.14.0 merge_join/MergeBy#left..foldrust-analyzer cargo itertools 0.14.0 adaptors/impl#[`PutBack<I>`][Iterator]fold().(acc, |acc, x| f(acc, F::leftrust-analyzer cargo itertools 0.14.0 merge_join/OrderingOrBool#left().(x))); |
| 295 | break; |
| 296 | } |
| 297 | (Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#, Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(r)) => { |
| 298 | self.rightrust-analyzer cargo itertools 0.14.0 merge_join/MergeBy#right..put_backrust-analyzer cargo itertools 0.14.0 adaptors/impl#[`PutBack<I>`]put_back().(r); |
| 299 | acc = self.rightrust-analyzer cargo itertools 0.14.0 merge_join/MergeBy#right..foldrust-analyzer cargo itertools 0.14.0 adaptors/impl#[`PutBack<I>`][Iterator]fold().(acc, |acc, x| f(acc, F::rightrust-analyzer cargo itertools 0.14.0 merge_join/OrderingOrBool#right().(x))); |
| 300 | break; |
| 301 | } |
| 302 | (Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#, Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#) => { |
| 303 | break; |
| 304 | } |
| 305 | } |
| 306 | } |
| 307 | |
| 308 | acc |
| 309 | } |
| 310 | |
| 311 | fn size_hintrust-analyzer cargo itertools 0.14.0 merge_join/impl#[`MergeBy<I, J, F>`][Iterator]size_hint().(&self) -> SizeHintrust-analyzer cargo itertools 0.14.0 size_hint/SizeHint# { |
| 312 | F::size_hintrust-analyzer cargo itertools 0.14.0 merge_join/OrderingOrBool#size_hint().(self.leftrust-analyzer cargo itertools 0.14.0 merge_join/MergeBy#left..size_hintrust-analyzer cargo itertools 0.14.0 adaptors/impl#[`PutBack<I>`][Iterator]size_hint().(), self.rightrust-analyzer cargo itertools 0.14.0 merge_join/MergeBy#right..size_hintrust-analyzer cargo itertools 0.14.0 adaptors/impl#[`PutBack<I>`][Iterator]size_hint().()) |
| 313 | } |
| 314 | |
| 315 | fn nthrust-analyzer cargo itertools 0.14.0 merge_join/impl#[`MergeBy<I, J, F>`][Iterator]nth().(&mut self, mut n: usize) -> Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Selfrust-analyzer cargo itertools 0.14.0 merge_join/impl#[`MergeBy<I, J, F>`][Iterator]::Itemrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#Item#> { |
| 316 | loop { |
| 317 | if n rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]eq().0 { |
| 318 | break self.nextrust-analyzer cargo itertools 0.14.0 merge_join/impl#[`MergeBy<I, J, F>`][Iterator]next().(); |
| 319 | } |
| 320 | n rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`SubAssign<Self>`]sub_assign().-=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`SubAssign<Self>`]sub_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`SubAssign<Self>`]sub_assign().1; |
| 321 | match (self.leftrust-analyzer cargo itertools 0.14.0 merge_join/MergeBy#left..nextrust-analyzer cargo itertools 0.14.0 adaptors/impl#[`PutBack<I>`][Iterator]next().(), self.rightrust-analyzer cargo itertools 0.14.0 merge_join/MergeBy#right..nextrust-analyzer cargo itertools 0.14.0 adaptors/impl#[`PutBack<I>`][Iterator]next().()) { |
| 322 | (Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#, Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#) => break Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#, |
| 323 | (Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(_left), Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#) => break self.leftrust-analyzer cargo itertools 0.14.0 merge_join/MergeBy#left..nthrust-analyzer cargo itertools 0.14.0 adaptors/impl#[`PutBack<I>`][Iterator]nth().(n).maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]map().(F::leftrust-analyzer cargo itertools 0.14.0 merge_join/OrderingOrBool#left().), |
| 324 | (Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#, Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(_right)) => break self.rightrust-analyzer cargo itertools 0.14.0 merge_join/MergeBy#right..nthrust-analyzer cargo itertools 0.14.0 adaptors/impl#[`PutBack<I>`][Iterator]nth().(n).maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]map().(F::rightrust-analyzer cargo itertools 0.14.0 merge_join/OrderingOrBool#right().), |
| 325 | (Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(left), Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(right)) => { |
| 326 | let (not_next, _) = self.cmp_fnrust-analyzer cargo itertools 0.14.0 merge_join/MergeBy#cmp_fn..mergerust-analyzer cargo itertools 0.14.0 merge_join/OrderingOrBool#merge().(left, right); |
| 327 | match not_next { |
| 328 | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(Eitherrust-analyzer cargo either 1.15.0 Either#::Leftrust-analyzer cargo either 1.15.0 Either#Left#(l)) => { |
| 329 | self.leftrust-analyzer cargo itertools 0.14.0 merge_join/MergeBy#left..put_backrust-analyzer cargo itertools 0.14.0 adaptors/impl#[`PutBack<I>`]put_back().(l); |
| 330 | } |
| 331 | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(Eitherrust-analyzer cargo either 1.15.0 Either#::Rightrust-analyzer cargo either 1.15.0 Either#Right#(r)) => { |
| 332 | self.rightrust-analyzer cargo itertools 0.14.0 merge_join/MergeBy#right..put_backrust-analyzer cargo itertools 0.14.0 adaptors/impl#[`PutBack<I>`]put_back().(r); |
| 333 | } |
| 334 | Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None# => (), |
| 335 | } |
| 336 | } |
| 337 | } |
| 338 | } |
| 339 | } |
| 340 | } |
| 341 | |
| 342 | impl<I, J, F> FusedIteratorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/marker/FusedIterator# for MergeByrust-analyzer cargo itertools 0.14.0 merge_join/MergeBy#<I, J, F> |
| 343 | where |
| 344 | I: Iteratorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#, |
| 345 | J: Iteratorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#, |
| 346 | F: OrderingOrBoolrust-analyzer cargo itertools 0.14.0 merge_join/OrderingOrBool#<I::Itemrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#Item#, J::Itemrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#Item#>, |
| 347 | { |
| 348 | } |