assert_into

Crates.ioassert_into
lib.rsassert_into
version1.1.0
sourcesrc
created_at2020-10-01 13:45:06.136484
updated_at2020-10-22 12:19:07.579385
descriptionFor when writing .try_into().unwrap() feels too long
homepage
repositoryhttps://github.com/voysys/assert_into
max_upload_size
id295027
size14,506
Jonathan Nilsson (JoNil)

documentation

https://docs.rs/assert_into

README

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

Commit count: 7

cargo fmt