Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

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.

@mo8it
Copy link
Contributor

mo8it commented Nov 20, 2025

Done in b5d440f after renaming the variable, adding missing mut and formatting. Thanks :)

@mo8it mo8it closed this Nov 20, 2025
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.

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.