5 stable releases
1.1.0 | Oct 22, 2020 |
---|---|
1.0.3 | Oct 1, 2020 |
#2790 in Rust patterns
855 downloads per month
Used in elf2uf2-rs
6KB
assert_into
For when writing .try_into().unwrap() feels too long.
use assert_into::AssertInto;
fn main() {
let a: u32 = (-1i32).assert_into();
}
Gives you: thread 'main' panicked at '-1 is out of range for type u32: TryFromIntError(())', src\main.rs:4:26