We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4978f42 commit df58872Copy full SHA for df58872
src/lib.rs
@@ -203,6 +203,7 @@ impl Not for Choice {
203
impl From<u8> for Choice {
204
#[inline]
205
fn from(input: u8) -> Choice {
206
+ debug_assert!((input == 0u8) | (input == 1u8));
207
// Our goal is to prevent the compiler from inferring that the value held inside the
208
// resulting `Choice` struct is really an `i1` instead of an `i8`.
209
Choice(core::hint::black_box(input))
0 commit comments