-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
new lint: repeat_vec_with_capacity
#11597
Conversation
r? @dswij (rustbot has picked a reviewer for you, use r? to override) |
☔ The latest upstream changes (presumably #11791) made this pull request unmergeable. Please resolve the merge conflicts. |
5574294
to
3f7dc80
Compare
@dswij you wanted me to ping you :) |
☔ The latest upstream changes (presumably #11781) made this pull request unmergeable. Please resolve the merge conflicts. |
3f7dc80
to
01f40fb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the late review.
Implementation looks great! Just some minor comments
/// ### What it does | ||
/// Looks for patterns such as `vec![Vec::with_capacity(x); n]` or `iter::repeat(Vec::with_capacity(x))`. | ||
/// | ||
/// ### Why is this bad? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent explanation!
01f40fb
to
8c63a3e
Compare
8c63a3e
to
76eb781
Compare
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
Closes #11537
Lint description should explain this PR :)
changelog: new lint:
repeat_vec_with_capacity