Applies `sf` to a single item and `pf` to a pair.
(self, mut sf: SF, mut pf: PF)
| 124 | impl<I> InvalidPairOrSingle<I> { |
| 125 | /// Applies `sf` to a single item and `pf` to a pair. |
| 126 | pub fn over<SF, PF, R>(self, mut sf: SF, mut pf: PF) -> R |
| 127 | where |
| 128 | SF: FnMut(I) -> R, |
| 129 | PF: FnMut(InvalidPair<I>) -> R, |
| 130 | { |
| 131 | match self { |
| 132 | Self::Pair(pair) => pf(pair), |
| 133 | Self::Single(cur) => sf(cur), |
| 134 | } |
| 135 | } |
| 136 | } |
| 137 | |
| 138 | /// This pair was invalid according to the supplied predicate. |