Zips `self` and another `CtOption` with function `f`. If `self.is_some() && other.is_some()`, this method returns a new [`CtOption`] for the result of `f` applied to their inner values where `is_some()` is [`Choice::TRUE`]. Otherwise, a [`CtOption`] where `is_some()` is [`Choice::FALSE`] is returned.
(self, other: CtOption<U>, f: F)
| 507 | /// |
| 508 | /// Otherwise, a [`CtOption`] where `is_some()` is [`Choice::FALSE`] is returned. |
| 509 | pub fn zip_with<U, F, R>(self, other: CtOption<U>, f: F) -> CtOption<R> |
| 510 | where |
| 511 | F: FnOnce(T, U) -> R, |
| 512 | { |
| 513 | self.zip(other).map(|(a, b)| f(a, b)) |
| 514 | } |
| 515 | } |
| 516 | |
| 517 | impl<T> CtOption<&T> { |