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

Method unwrap_or

ctutils/src/ct_option.rs:454–459  ·  view source on GitHub ↗
(self, default: T)

Source from the content-addressed store, hash-verified

452 #[inline]
453 #[must_use]
454 pub fn unwrap_or(self, default: T) -> T
455 where
456 T: CtSelect,
457 {
458 default.ct_select(&self.value, self.is_some)
459 }
460
461 /// Unconditionally computes `T::default()` using the [`Default`] trait, then returns either
462 /// the contained value if `self.is_some()` is [`Choice::TRUE`], or if it's [`Choice::FALSE`]

Callers 5

map_orMethod · 0.80
unwrap_or_defaultMethod · 0.80
fromMethod · 0.80
checkctFunction · 0.80
checkctFunction · 0.80

Calls 1

ct_selectMethod · 0.45

Tested by

no test coverage detected