rustlings icon indicating copy to clipboard operation
rustlings copied to clipboard

vecs1: add hint for to_vec()

Open RogerJL opened this issue 1 year ago • 2 comments

It actually only case 2 that fulfils the excersise instruction to use macro...

RogerJL avatar Jul 06 '23 08:07 RogerJL

hmm, I disagree, to_vec doesn't define a vec, it copies into a vec. I don't think that's the solution we should hint at here, but it could be something we encourage users to try out in addition (something like "By the way, there's also a way to convert the array into a Vec directly, without having to specify its values again. Can you find out what it is?"

shadows-withal avatar Sep 04 '23 12:09 shadows-withal

But to_vec also define a vector... The vector did not exist before this method is called.

RogerJL avatar Sep 09 '23 19:09 RogerJL

Closing because I don't think we should recommend .to_vec() in this case :)

mo8it avatar Jun 24 '24 11:06 mo8it