I would have expected that if I have implemented From<T> for S then I get From<Vec<T>> for Vec<S> for free. However looking at the From Documentation I find nothing like this. I also cannot implement this myself, because both Vec and From are defined externally.
What is the recommended way to convert from Vec<i32> to Vec<i64>, say? In this Playground I wrote a custom from function to illustrate what I want to do. What's annoying is that this way I won't get into functions for free.
Thanks! Would you say that the way I do it in the Playground is alright, or is there something to improve? Can it be done for types which don't include the Clone trait?
(Since I'm quite new to Rust, I always feel a bit insecure if what I do makes any sense )
If you need to use that for several types, you can write a generic function or a blanket trait implementation that avoids the problem where you accidentally re-implement the From<X> for X.