Skip to content

Conversation

yutanagano
Copy link

Hi rustlings team! Thank you all for maintaining this amazing resource for learning Rust.

I had recently gone through the clippy exercises and I noticed that in clippy3 one of the things clippy is supposed to pick up on is to suggest clearing a Vec instead of resizeing it to len 0 (at least judging from the current example solution for the exercise). In the current form of the exercise, clippy actually doesn't do this and instead just tells you to not initialise a Vec and then immediately resize it to len 0 (it is currently all done in one line) (tbf that is fair advice by clippy!).

But if you would like the intended advice of "you should use clear instead", you can get that by separating the initialisation and the resizing. This is a tiny PR just doing that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant