pub trait Unref { fn unref(a: Self) -> T; } impl<'a> Unref for &'a f32 { #[inline(always)] fn unref(a: &f32) -> f32 { *a } } impl<'a> Unref for &'a f64 { #[inline(always)] fn unref(a: &f64) -> f64 { *a } } impl<'a> Unref for &'a bool { #[inline(always)] fn unref(a: &bool) -> bool { *a } } impl<'a, T> Unref<&'a T> for &'a T { #[inline(always)] fn unref(a: &'a T) -> &'a T { a } } #[inline(always)] pub fn unref, O>(val: T) -> O { Unref::unref(val) }