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

Method to_u8

ctutils/src/choice.rs:422–427  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

420 /// Convert [`Choice`] to a `u8`, attempting to apply a "best effort" optimization barrier.
421 #[must_use]
422 pub const fn to_u8(self) -> u8 {
423 // `black_box` is documented as working on a "best effort" basis. That's fine, this type is
424 // likewise documented as only working on a "best effort" basis itself. The only way we
425 // rely on `black_box` for correctness is it behaving as the identity function.
426 core::hint::black_box(self.0)
427 }
428
429 /// DEPRECATED: previously a workaround to allow `const fn` boolean support on Rust 1.85.
430 ///

Callers 15

andMethod · 0.80
from_u128_lt_halvesMethod · 0.80
to_boolMethod · 0.80
to_u8_vartimeMethod · 0.80
to_u8_maskMethod · 0.80
to_u16_maskMethod · 0.80
to_u32_maskMethod · 0.80
to_u64_maskMethod · 0.80
to_u128_maskMethod · 0.80
fromMethod · 0.80
choice_ltFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected