Hello. I often create test vectors with Range and collect like so:
let my_vec = (1…10).collect::<Vec>();
I find it more useful than just writing
let my_vec = vec![1,2,3,4,5,6,7,8,9];
Only recently I wanted to create a vector of floats and found out that collect does not do:
let my_vec = (1f32…10f32).collect::<Vec>();
Rust compiler already pointed out that there is no Range iterator method. Or at least, that is what I understood.
Is there a way to keep my syntax here, like, just importing something, or would you recommend something else (better in your opinion).
Thank you a lot