rendy_util
pub fn identical_cast<T: 'static, U: 'static>(value: T) -> U
Casts identical types. Useful in generic environment where caller knows that two types are the same but Rust is not convinced.
Panics if types are actually different.
if TypeId::of::<T>() == TypeId::of::<u32>() { let value: T = identical_cast(42u32); }