rendy::util
pub fn identical_cast<T, U>(value: T) -> U where T: 'static, U: 'static,
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); }