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

Method to_bool

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

Source from the content-addressed store, hash-verified

389 // TODO(tarcieri): `const fn` when MSRV 1.86
390 #[must_use]
391 pub fn to_bool(self) -> bool {
392 self.to_u8() != 0
393 }
394
395 /// Convert [`Choice`] to a `u8`, attempting to apply a "best effort" optimization barrier.
396 // TODO(tarcieri): `const fn` when MSRV 1.86

Callers 2

into_optionMethod · 0.80
fromMethod · 0.80

Calls 1

to_u8Method · 0.80

Tested by

no test coverage detected