as_cast

Function as_cast 

Source
pub fn as_cast<U: AsCast, T: AsCast>(t: T) -> U
Expand description

Allows the high-level conversion of generic types as if as was used.

ยงExamples

use lexical_util::num::as_cast;

assert_eq!(as_cast::<u8, u16>(256u16), 256u16 as u8); // 0