| 1 | use superrust-analyzer cargo itertools 0.14.0 crate/::size_hintrust-analyzer cargo itertools 0.14.0 size_hint/; |
| 2 | 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#::{Equalrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Ordering#Equal#, Greaterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Ordering#Greater#, Lessrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Ordering#Less#}; |
| 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 | |
| 5 | 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#; |
| 6 | |
| 7 | // ZipLongest originally written by SimonSapin, |
| 8 | // and dedicated to itertools https://github.com/rust-lang/rust/pull/19283 |
| 9 | |
| 10 | /// An iterator which iterates two other iterators simultaneously |
| 11 | /// and wraps the elements in [`EitherOrBoth`]. |
| 12 | /// |
| 13 | /// This iterator is *fused*. |
| 14 | /// |
| 15 | /// See [`.zip_longest()`](crate::Itertools::zip_longest) for more information. |
| 16 | #[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:)] |
| 17 | #[must_use = "iterator adaptors are lazy and do nothing unless consumed"] |
| 18 | pub struct ZipLongestrust-analyzer cargo itertools 0.14.0 zip_longest/ZipLongest#<T, U> { |
| 19 | arust-analyzer cargo itertools 0.14.0 zip_longest/ZipLongest#a.: Fuserust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/adapters/fuse/Fuse#<T>, |
| 20 | brust-analyzer cargo itertools 0.14.0 zip_longest/ZipLongest#b.: Fuserust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/adapters/fuse/Fuse#<U>, |
| 21 | } |
| 22 | |
| 23 | /// Create a new `ZipLongest` iterator. |
| 24 | pub fn zip_longestrust-analyzer cargo itertools 0.14.0 zip_longest/zip_longest().<T, U>(a: T, b: U) -> ZipLongestrust-analyzer cargo itertools 0.14.0 zip_longest/ZipLongest#<T, U> |
| 25 | where |
| 26 | T: Iteratorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#, |
| 27 | U: Iteratorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#, |
| 28 | { |
| 29 | ZipLongestrust-analyzer cargo itertools 0.14.0 zip_longest/ZipLongest# { |
| 30 | arust-analyzer cargo itertools 0.14.0 zip_longest/ZipLongest#a.: a.fuserust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#fuse().(), |
| 31 | brust-analyzer cargo itertools 0.14.0 zip_longest/ZipLongest#b.: b.fuserust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#fuse().(), |
| 32 | } |
| 33 | } |
| 34 | |
| 35 | impl<T, U> Iteratorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator# for ZipLongestrust-analyzer cargo itertools 0.14.0 zip_longest/ZipLongest#<T, U> |
| 36 | where |
| 37 | T: Iteratorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#, |
| 38 | U: Iteratorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#, |
| 39 | { |
| 40 | type Itemrust-analyzer cargo itertools 0.14.0 zip_longest/impl#[`ZipLongest<T, U>`][Iterator]Item# = EitherOrBothrust-analyzer cargo itertools 0.14.0 either_or_both/EitherOrBoth#<T::Itemrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#Item#, U::Itemrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#Item#>; |
| 41 | |
| 42 | #[inline] |
| 43 | fn nextrust-analyzer cargo itertools 0.14.0 zip_longest/impl#[`ZipLongest<T, U>`][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 zip_longest/impl#[`ZipLongest<T, U>`][Iterator]::Itemrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#Item#> { |
| 44 | match (self.arust-analyzer cargo itertools 0.14.0 zip_longest/ZipLongest#a..nextrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/adapters/fuse/impl#[`Fuse<I>`][Iterator]next().(), self.brust-analyzer cargo itertools 0.14.0 zip_longest/ZipLongest#b..nextrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/adapters/fuse/impl#[`Fuse<I>`][Iterator]next().()) { |
| 45 | (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#, |
| 46 | (Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(a), 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#(EitherOrBothrust-analyzer cargo itertools 0.14.0 either_or_both/EitherOrBoth#::Leftrust-analyzer cargo itertools 0.14.0 either_or_both/EitherOrBoth#Left#(a)), |
| 47 | (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#(b)) => Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(EitherOrBothrust-analyzer cargo itertools 0.14.0 either_or_both/EitherOrBoth#::Rightrust-analyzer cargo itertools 0.14.0 either_or_both/EitherOrBoth#Right#(b)), |
| 48 | (Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(a), Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(b)) => Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(EitherOrBothrust-analyzer cargo itertools 0.14.0 either_or_both/EitherOrBoth#::Bothrust-analyzer cargo itertools 0.14.0 either_or_both/EitherOrBoth#Both#(a, b)), |
| 49 | } |
| 50 | } |
| 51 | |
| 52 | #[inline] |
| 53 | fn size_hintrust-analyzer cargo itertools 0.14.0 zip_longest/impl#[`ZipLongest<T, U>`][Iterator]size_hint().(&self) -> (usize, Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<usize>) { |
| 54 | size_hintrust-analyzer cargo itertools 0.14.0 size_hint/::maxrust-analyzer cargo itertools 0.14.0 size_hint/max().(self.arust-analyzer cargo itertools 0.14.0 zip_longest/ZipLongest#a..size_hintrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/adapters/fuse/impl#[`Fuse<I>`][Iterator]size_hint().(), self.brust-analyzer cargo itertools 0.14.0 zip_longest/ZipLongest#b..size_hintrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/adapters/fuse/impl#[`Fuse<I>`][Iterator]size_hint().()) |
| 55 | } |
| 56 | |
| 57 | #[inline] |
| 58 | fn foldrust-analyzer cargo itertools 0.14.0 zip_longest/impl#[`ZipLongest<T, U>`][Iterator]fold().<B, F>(self, init: B, mut f: F) -> B |
| 59 | where |
| 60 | Selfrust-analyzer cargo itertools 0.14.0 zip_longest/impl#[`ZipLongest<T, U>`][Iterator]: Sizedrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Sized#, |
| 61 | F: FnMutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/function/FnMut#(B, Selfrust-analyzer cargo itertools 0.14.0 zip_longest/impl#[`ZipLongest<T, U>`][Iterator]::Itemrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#Item#) -> B, |
| 62 | { |
| 63 | let Selfrust-analyzer cargo itertools 0.14.0 zip_longest/impl#[`ZipLongest<T, U>`][Iterator] { mut arust-analyzer cargo itertools 0.14.0 zip_longest/ZipLongest#a., mut brust-analyzer cargo itertools 0.14.0 zip_longest/ZipLongest#b. } = self; |
| 64 | let res = a.try_foldrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/adapters/fuse/impl#[`Fuse<I>`][Iterator]try_fold().(init, |init, a| match b.nextrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/adapters/fuse/impl#[`Fuse<I>`][Iterator]next().() { |
| 65 | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(b) => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(f(init, EitherOrBothrust-analyzer cargo itertools 0.14.0 either_or_both/EitherOrBoth#::Bothrust-analyzer cargo itertools 0.14.0 either_or_both/EitherOrBoth#Both#(a, b))), |
| 66 | Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None# => Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(f(init, EitherOrBothrust-analyzer cargo itertools 0.14.0 either_or_both/EitherOrBoth#::Leftrust-analyzer cargo itertools 0.14.0 either_or_both/EitherOrBoth#Left#(a))), |
| 67 | }); |
| 68 | match res { |
| 69 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(acc) => b.maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#map().(EitherOrBothrust-analyzer cargo itertools 0.14.0 either_or_both/EitherOrBoth#::Rightrust-analyzer cargo itertools 0.14.0 either_or_both/EitherOrBoth#Right#).foldrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/adapters/map/impl#[`Map<I, F>`][Iterator]fold().(acc, f), |
| 70 | Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(acc) => a.maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#map().(EitherOrBothrust-analyzer cargo itertools 0.14.0 either_or_both/EitherOrBoth#::Leftrust-analyzer cargo itertools 0.14.0 either_or_both/EitherOrBoth#Left#).foldrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/adapters/map/impl#[`Map<I, F>`][Iterator]fold().(acc, f), |
| 71 | } |
| 72 | } |
| 73 | } |
| 74 | |
| 75 | impl<T, U> DoubleEndedIteratorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/double_ended/DoubleEndedIterator# for ZipLongestrust-analyzer cargo itertools 0.14.0 zip_longest/ZipLongest#<T, U> |
| 76 | where |
| 77 | T: DoubleEndedIteratorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/double_ended/DoubleEndedIterator# + ExactSizeIteratorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/exact_size/ExactSizeIterator#, |
| 78 | U: DoubleEndedIteratorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/double_ended/DoubleEndedIterator# + ExactSizeIteratorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/exact_size/ExactSizeIterator#, |
| 79 | { |
| 80 | #[inline] |
| 81 | fn next_backrust-analyzer cargo itertools 0.14.0 zip_longest/impl#[`ZipLongest<T, U>`][DoubleEndedIterator]next_back().(&mut self) -> Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Selfrust-analyzer cargo itertools 0.14.0 zip_longest/impl#[`ZipLongest<T, U>`][DoubleEndedIterator]::Itemrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#Item#> { |
| 82 | match self.arust-analyzer cargo itertools 0.14.0 zip_longest/ZipLongest#a..lenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/adapters/fuse/impl#[`Fuse<I>`][ExactSizeIterator]len().().cmprust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][Ord]cmp().(&self.brust-analyzer cargo itertools 0.14.0 zip_longest/ZipLongest#b..lenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/adapters/fuse/impl#[`Fuse<I>`][ExactSizeIterator]len().()) { |
| 83 | Equalrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Ordering#Equal# => match (self.arust-analyzer cargo itertools 0.14.0 zip_longest/ZipLongest#a..next_backrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/adapters/fuse/impl#[`Fuse<I>`][DoubleEndedIterator]next_back().(), self.brust-analyzer cargo itertools 0.14.0 zip_longest/ZipLongest#b..next_backrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/adapters/fuse/impl#[`Fuse<I>`][DoubleEndedIterator]next_back().()) { |
| 84 | (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#, |
| 85 | (Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(a), Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(b)) => Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(EitherOrBothrust-analyzer cargo itertools 0.14.0 either_or_both/EitherOrBoth#::Bothrust-analyzer cargo itertools 0.14.0 either_or_both/EitherOrBoth#Both#(a, b)), |
| 86 | // These can only happen if .len() is inconsistent with .next_back() |
| 87 | (Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(a), 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#(EitherOrBothrust-analyzer cargo itertools 0.14.0 either_or_both/EitherOrBoth#::Leftrust-analyzer cargo itertools 0.14.0 either_or_both/EitherOrBoth#Left#(a)), |
| 88 | (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#(b)) => Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(EitherOrBothrust-analyzer cargo itertools 0.14.0 either_or_both/EitherOrBoth#::Rightrust-analyzer cargo itertools 0.14.0 either_or_both/EitherOrBoth#Right#(b)), |
| 89 | }, |
| 90 | Greaterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Ordering#Greater# => self.arust-analyzer cargo itertools 0.14.0 zip_longest/ZipLongest#a..next_backrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/adapters/fuse/impl#[`Fuse<I>`][DoubleEndedIterator]next_back().().maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]map().(EitherOrBothrust-analyzer cargo itertools 0.14.0 either_or_both/EitherOrBoth#::Leftrust-analyzer cargo itertools 0.14.0 either_or_both/EitherOrBoth#Left#), |
| 91 | Lessrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Ordering#Less# => self.brust-analyzer cargo itertools 0.14.0 zip_longest/ZipLongest#b..next_backrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/adapters/fuse/impl#[`Fuse<I>`][DoubleEndedIterator]next_back().().maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]map().(EitherOrBothrust-analyzer cargo itertools 0.14.0 either_or_both/EitherOrBoth#::Rightrust-analyzer cargo itertools 0.14.0 either_or_both/EitherOrBoth#Right#), |
| 92 | } |
| 93 | } |
| 94 | |
| 95 | fn rfoldrust-analyzer cargo itertools 0.14.0 zip_longest/impl#[`ZipLongest<T, U>`][DoubleEndedIterator]rfold().<B, F>(self, mut init: B, mut f: F) -> B |
| 96 | where |
| 97 | F: FnMutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/function/FnMut#(B, Selfrust-analyzer cargo itertools 0.14.0 zip_longest/impl#[`ZipLongest<T, U>`][DoubleEndedIterator]::Itemrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#Item#) -> B, |
| 98 | { |
| 99 | let Selfrust-analyzer cargo itertools 0.14.0 zip_longest/impl#[`ZipLongest<T, U>`][DoubleEndedIterator] { mut arust-analyzer cargo itertools 0.14.0 zip_longest/ZipLongest#a., mut brust-analyzer cargo itertools 0.14.0 zip_longest/ZipLongest#b. } = self; |
| 100 | let a_len = a.lenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/adapters/fuse/impl#[`Fuse<I>`][ExactSizeIterator]len().(); |
| 101 | let b_len = b.lenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/adapters/fuse/impl#[`Fuse<I>`][ExactSizeIterator]len().(); |
| 102 | match a_len.cmprust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][Ord]cmp().(&b_len) { |
| 103 | Equalrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Ordering#Equal# => {} |
| 104 | Greaterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Ordering#Greater# => { |
| 105 | init = a |
| 106 | .by_refrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#by_ref().() |
| 107 | .revrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#rev().() |
| 108 | .takerust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#take().(a_len rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().b_len) |
| 109 | .maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#map().(EitherOrBothrust-analyzer cargo itertools 0.14.0 either_or_both/EitherOrBoth#::Leftrust-analyzer cargo itertools 0.14.0 either_or_both/EitherOrBoth#Left#) |
| 110 | .foldrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/adapters/map/impl#[`Map<I, F>`][Iterator]fold().(init, &mut f) |
| 111 | } |
| 112 | Lessrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Ordering#Less# => { |
| 113 | init = b |
| 114 | .by_refrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#by_ref().() |
| 115 | .revrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#rev().() |
| 116 | .takerust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#take().(b_len rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().a_len) |
| 117 | .maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#map().(EitherOrBothrust-analyzer cargo itertools 0.14.0 either_or_both/EitherOrBoth#::Rightrust-analyzer cargo itertools 0.14.0 either_or_both/EitherOrBoth#Right#) |
| 118 | .foldrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/adapters/map/impl#[`Map<I, F>`][Iterator]fold().(init, &mut f) |
| 119 | } |
| 120 | } |
| 121 | a.rfoldrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/adapters/fuse/impl#[`Fuse<I>`][DoubleEndedIterator]rfold().(init, |acc, item_a| { |
| 122 | f(acc, EitherOrBothrust-analyzer cargo itertools 0.14.0 either_or_both/EitherOrBoth#::Bothrust-analyzer cargo itertools 0.14.0 either_or_both/EitherOrBoth#Both#(item_a, b.next_backrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/adapters/fuse/impl#[`Fuse<I>`][DoubleEndedIterator]next_back().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap().())) |
| 123 | }) |
| 124 | } |
| 125 | } |
| 126 | |
| 127 | impl<T, U> ExactSizeIteratorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/exact_size/ExactSizeIterator# for ZipLongestrust-analyzer cargo itertools 0.14.0 zip_longest/ZipLongest#<T, U> |
| 128 | where |
| 129 | T: ExactSizeIteratorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/exact_size/ExactSizeIterator#, |
| 130 | U: ExactSizeIteratorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/exact_size/ExactSizeIterator#, |
| 131 | { |
| 132 | } |
| 133 | |
| 134 | impl<T, U> FusedIteratorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/marker/FusedIterator# for ZipLongestrust-analyzer cargo itertools 0.14.0 zip_longest/ZipLongest#<T, U> |
| 135 | where |
| 136 | T: Iteratorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#, |
| 137 | U: Iteratorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#, |
| 138 | { |
| 139 | } |