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

Method select_u8

ctutils/src/choice.rs:350–352  ·  view source on GitHub ↗
(self, a: u8, b: u8)

Source from the content-addressed store, hash-verified

348 #[inline]
349 #[must_use]
350 pub const fn select_u8(self, a: u8, b: u8) -> u8 {
351 a ^ (self.to_u8_mask() & (a ^ b))
352 }
353
354 /// `const fn` helper: return `b` if `self` is [`Choice::TRUE`], otherwise return `a`.
355 ///

Callers

nothing calls this directly

Calls 1

to_u8_maskMethod · 0.80

Tested by

no test coverage detected