5 stable releases
1.1.0 | Oct 22, 2020 |
---|---|
1.0.3 | Oct 1, 2020 |
#2531 in Rust patterns
979 downloads per month
Used in 2 crates
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