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

Method select_u8

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

Source from the content-addressed store, hash-verified

322 #[inline]
323 #[must_use]
324 pub const fn select_u8(self, a: u8, b: u8) -> u8 {
325 a ^ (self.to_u8_mask() & (a ^ b))
326 }
327
328 /// `const fn` helper: return `b` if `self` is [`Choice::TRUE`], otherwise return `a`.
329 ///

Callers

nothing calls this directly

Calls 1

to_u8_maskMethod · 0.80

Tested by

no test coverage detected