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

Method ok_or

ctutils/src/ct_option.rs:365–367  ·  view source on GitHub ↗
(self, err: E)

Source from the content-addressed store, hash-verified

363 /// - Returns `err` in the event `self.is_some()` is [`Choice::FALSE`].
364 #[inline]
365 pub fn ok_or<E>(self, err: E) -> Result<T, E> {
366 self.into_option().ok_or(err)
367 }
368
369 /// Transforms a `CtOption<T>` into a `Result<T, E>` by unconditionally calling the provided
370 /// callback value and using its result in the event `self.is_some()` is [`Choice::FALSE`].

Callers 2

ok_or_elseMethod · 0.80
unpad_blocksMethod · 0.80

Calls 1

into_optionMethod · 0.80

Tested by

no test coverage detected