I want to convert au_rect: Rect<Au, LayoutPixel>
to f32_rect: Rect<f32, LayoutPixel>
by au_rect.to_f32()
, as the compiler prompts:
26 | pub struct Au(pub i32);
| ----------------------- doesn't satisfy `Au: num_traits::cast::NumCast`
|
= note: the method `to_f32` exists but the following trait bounds were not satisfied:
`Au: num_traits::cast::NumCast`
Can we just impl NumCast
for Au
?