Skip to content

Conversation

kyoto7250
Copy link
Contributor

@kyoto7250 kyoto7250 commented Jun 12, 2022

close #8915

This PR adds default_iter_empty lint.

This lint checks std::iter::Empty::default() and replace with std::iter::empty().

Thank you in advance.


changelog: add default_instead_of_iter_empty lint.

@rust-highfive
Copy link

r? @Alexendoo

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Jun 12, 2022
@kyoto7250 kyoto7250 force-pushed the default_iter_empty branch from 0156861 to 31ea7af Compare June 12, 2022 23:01
@kyoto7250 kyoto7250 marked this pull request as ready for review June 12, 2022 23:15
@bors
Copy link
Contributor

bors commented Jun 15, 2022

☔ The latest upstream changes (presumably #8964) made this pull request unmergeable. Please resolve the merge conflicts.

@kyoto7250 kyoto7250 force-pushed the default_iter_empty branch from 0297db5 to 3da4fa3 Compare June 15, 2022 07:00
@kyoto7250 kyoto7250 force-pushed the default_iter_empty branch from a629bb9 to a3097e1 Compare June 16, 2022 13:27
@kyoto7250
Copy link
Contributor Author

@Alexendoo

I commited your suggestion.

Could I request your review?

@kyoto7250 kyoto7250 requested a review from Alexendoo June 16, 2022 13:45
@kyoto7250 kyoto7250 force-pushed the default_iter_empty branch from ee253ad to 01a4ecf Compare June 17, 2022 01:39
@kyoto7250
Copy link
Contributor Author

I pushed some commits.

If we need to do git squash, please let me know.

@kyoto7250 kyoto7250 requested a review from Alexendoo June 17, 2022 02:00
@Alexendoo
Copy link
Member

Yeah a squash would be good thanks

Update description in clippy_lints/src/default_iter_empty.rs

Co-authored-by: Fridtjof Stoldt <xFrednet@gmail.com>

Update clippy_lints/src/default_iter_empty.rs

Co-authored-by: Alex Macleod <alex@macleod.io>

Update clippy_lints/src/default_iter_empty.rs

Co-authored-by: Alex Macleod <alex@macleod.io>

renamed default_iter_empty to default_instead_of_iter_empty

Avoid duplicate messages

add tests for regression

rewrite 'Why is this bad?'

cargo dev fmt

delete default_iter_empty lint in renamed_lint.rs

rewrite a message in the suggestion

cargo dev update_lints --check
@kyoto7250 kyoto7250 force-pushed the default_iter_empty branch from f01e7e5 to 2bb8c45 Compare June 17, 2022 12:35
@Alexendoo
Copy link
Member

Thanks!

@bors r+

@bors
Copy link
Contributor

bors commented Jun 17, 2022

📌 Commit 2bb8c45 has been approved by Alexendoo

@bors
Copy link
Contributor

bors commented Jun 17, 2022

⌛ Testing commit 2bb8c45 with merge e933bb6...

@bors
Copy link
Contributor

bors commented Jun 17, 2022

☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test
Approved by: Alexendoo
Pushing e933bb6 to master...

@bors bors merged commit e933bb6 into rust-lang:master Jun 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Prefer std::iter::empty() to std::iter::Empty::default()
5 participants