MCPcopy Create free account
hub / github.com/docknetwork/crypto / over

Method over

utils/src/try_iter.rs:126–135  ·  view source on GitHub ↗

Applies `sf` to a single item and `pf` to a pair.

(self, mut sf: SF, mut pf: PF)

Source from the content-addressed store, hash-verified

124impl<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.

Callers 2

initMethod · 0.80
initMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected