(self, f: F)
| 341 | #[inline] |
| 342 | #[must_use] |
| 343 | pub fn map_or_default<U, F>(self, f: F) -> U |
| 344 | where |
| 345 | U: CtSelect + Default, |
| 346 | F: FnOnce(T) -> U, |
| 347 | { |
| 348 | self.map_or(U::default(), f) |
| 349 | } |
| 350 | |
| 351 | /// Transforms a `CtOption<T>` into a `Result<T, E>`, mapping to `Ok(T)` if `self.is_some()` is |
| 352 | /// [`Choice::TRUE`], or mapping to the provided `err` in the event `self.is_some()` is |