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

Method select_u16

ctutils/src/choice.rs:334–336  ·  view source on GitHub ↗
(self, a: u16, b: u16)

Source from the content-addressed store, hash-verified

332 #[inline]
333 #[must_use]
334 pub const fn select_u16(self, a: u16, b: u16) -> u16 {
335 a ^ (self.to_u16_mask() & (a ^ b))
336 }
337
338 /// `const fn` helper: return `b` if `self` is [`Choice::TRUE`], otherwise return `a`.
339 ///

Callers

nothing calls this directly

Calls 1

to_u16_maskMethod · 0.80

Tested by

no test coverage detected