So, started down a rabbit hole of generics in Rust, and ran across this problem:
struct MyStruct<T> {
value: T,
}
I'd like to define a generic definition for converting from one MyStruct to another, for example from MyStruct<f64> to MyStruct<f32>
My first approach was something like this:
impl<U, T> From<MyStruct<U>> for MyStruct<T>
where
T: From<U>,
{...}
But, of course, this leads to a conflicting definition, when T is U, since I don't know how to specify that T and U are not the same type.
I'm curious to see if anyone has done something similar.



