MCPcopy Create free account
hub / github.com/RustCrypto/utils / ok_or_else

Method ok_or_else

ctutils/src/ct_option.rs:383–388  ·  view source on GitHub ↗
(self, err: F)

Source from the content-addressed store, hash-verified

381 #[inline]
382 #[allow(clippy::missing_errors_doc)]
383 pub fn ok_or_else<E, F>(self, err: F) -> Result<T, E>
384 where
385 F: FnOnce() -> E,
386 {
387 self.ok_or(err())
388 }
389
390 /// Returns `self` if `self.is_some()` is [`Choice::TRUE`], otherwise returns `optb`.
391 #[inline]

Callers

nothing calls this directly

Calls 1

ok_orMethod · 0.80

Tested by

no test coverage detected