Hi,
have been programming rust for three days now: excellent stuff
I'm trying to get similar functionality to the following C++ code:
std::algorithm::copy(double_c.begin(), double_c.end(), int_c.begin());
or
std::numeric::iota(double_c.begin(), double_c.end(), 17);
In Rust I was trying variants of
double_c = (17..double_c.len()).map(|x| x as f64).collect();
```
but `rustc` is giving me `FromIterator<i32>` trait not satisfied for `f64` collections. Is there a way to get this working ad hoc? (without implementing `FromIterator<i32>`)
Thanks for any help
PS/Rant: Shouldn't this have a default implementation? (I mean, it's just casting i32 to f64, which doesn't lose any accuracy).