pub trait Number: NumConv { pure fn from(n: T) -> Self; } impl Number for float { pure fn from(n: T) -> float { n.to_float() } } pub trait NumConv { pure fn to_float(&self) -> float; } impl NumConv for float { pure fn to_float(&self) -> float { *self } } pub fn main() { let _: float = Number::from(0.0f); }