[][src]Macro genie_support::infallible_try_into

macro_rules! infallible_try_into {
    ($from:ident, $to:ty) => { ... };
}

Create an infallible TryInto implementation for an ID container type that returns its contained number as the given target type.

Example

use genie_support::infallible_try_into;
use std::convert::TryInto;
struct Container(u16);
infallible_try_into!(Container, u32);
let num: u32 = Container(12).try_into().unwrap();
assert_eq!(num, 12u32);