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

Method from_u8_lt

ctutils/src/choice.rs:125–135  ·  view source on GitHub ↗
(x: u8, y: u8)

Source from the content-addressed store, hash-verified

123 #[inline]
124 #[must_use]
125 pub const fn from_u8_lt(x: u8, y: u8) -> Self {
126 // On Thumb-1, constant specialization can turn a narrow comparison into a branch.
127 #[cfg(all(target_arch = "arm", not(target_has_atomic = "ptr")))]
128 {
129 Self::from_u32_lt(x as u32, y as u32)
130 }
131 #[cfg(not(all(target_arch = "arm", not(target_has_atomic = "ptr"))))]
132 {
133 Self::from_u8_lsb(crate::primitives::bitlt!(x, y, u8::BITS))
134 }
135 }
136
137 /// Returns [`Choice::TRUE`] if `value != 0`, and [`Choice::FALSE`] otherwise.
138 #[inline]

Callers

nothing calls this directly

Calls 2

from_u32_ltFunction · 0.85
from_u8_lsbFunction · 0.85

Tested by

no test coverage detected