(self, default: U, f: F)
| 328 | #[inline] |
| 329 | #[must_use = "if you don't need the returned value, use `if let` instead"] |
| 330 | pub fn map_or<U, F>(self, default: U, f: F) -> U |
| 331 | where |
| 332 | U: CtSelect, |
| 333 | F: FnOnce(T) -> U, |
| 334 | { |
| 335 | self.map(f).unwrap_or(default) |
| 336 | } |
| 337 | |
| 338 | /// Maps a `CtOption<T>` to a `U` value, eagerly evaluating the provided function, precomputing |
| 339 | /// `U::default()` using the [`Default`] trait, and returning it in the event `self.is_some()` |
no test coverage detected