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

Method expect_ref

ctutils/src/ct_option.rs:160–164  ·  view source on GitHub ↗
(&self, msg: &str)

Source from the content-addressed store, hash-verified

158 #[must_use]
159 #[track_caller]
160 pub const fn expect_ref(&self, msg: &str) -> &T {
161 // TODO(tarcieri): use `self.is_some().to_bool()` when MSRV is 1.86
162 assert!(self.is_some.to_bool_vartime(), "{}", msg);
163 self.as_inner_unchecked()
164 }
165
166 /// Inserts `value` into the [`CtOption`], then returns a mutable reference to it.
167 ///

Callers 1

expect_copiedMethod · 0.80

Calls 1

as_inner_uncheckedMethod · 0.80

Tested by

no test coverage detected