-
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
Use .into_iter()
rather than .drain(..)
#8483
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @giraffate (or someone else) soon. Please see the contribution instructions for more information. |
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.
It looks like that some tests are failing. Can they be addressed?
9189f60
to
275a1b0
Compare
|
||
if let Some(range) = higher::Range::hir(arg) { | ||
let left_full = match range { | ||
Range { start: Some(start), .. } if is_integer_const(cx, start, 0) => true, |
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.
This could be extended in the future to suggest .into_iter().skip(N)
for constants != 0
.
Doesn't necessarily have to be done in this PR though.
8bc83aa
to
a176d11
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.
LGTM overall. Just one small comment.
I leave the final review and approval to @giraffate
7599526
to
c7f574c
Compare
c7f574c
to
ad295b8
Compare
Add doc Add description iter_with_drain dogfood Disable emiting on struct field. Fix clippy Add eq_path for SpanlessEq Fix tests Better error message Fix doc test Fix version Apply suggestions
ad295b8
to
6cc2eea
Compare
@bors r=flip1995,giraffate It looks good, thanks! |
📌 Commit 6cc2eea has been approved by |
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
Replacing
.drain(..)
with.into_iter()
makes my project's binary size smaller.Fixes #1908
Applicability of this suggestion is
MaybeIncorrect
rather thanMachineApplicable
due to the complexity of "checking otherwise usage" X-|changelog: Add new lint [
iter_with_drain
]