Skip to content

Conversation

y21
Copy link
Member

@y21 y21 commented Nov 15, 2023

Fixes #11807

Few things worth mentioning:

  • Taking snippets is now done at callsite, instead of passing a span and doing it in emit_redundant_guards. This is because we now need custom suggestion strings in certain places, like "" for str::is_empty.
  • This now uses snippet instead of snippet_with_applicability. I don't think this really makes any difference for MaybeIncorrect, though?
  • This could also lint byte strings, as they're of type &[u8; N], but that can be ugly so I decided to leave it out for now

changelog: [redundant_guards]: catch str::is_empty, slice::is_empty, slice::starts_with and slice::ends_with

@rustbot
Copy link
Collaborator

rustbot commented Nov 15, 2023

r? @llogiq

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Nov 15, 2023
@llogiq
Copy link
Contributor

llogiq commented Nov 29, 2023

This looks good to me. Thank you!

@bors r+

@bors
Copy link
Contributor

bors commented Nov 29, 2023

📌 Commit 8f9c738 has been approved by llogiq

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented Nov 29, 2023

⌛ Testing commit 8f9c738 with merge 8b0bf64...

@bors
Copy link
Contributor

bors commented Nov 29, 2023

☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test
Approved by: llogiq
Pushing 8b0bf64 to master...

@bors bors merged commit 8b0bf64 into rust-lang:master Nov 29, 2023
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.

redundant_guards could lint against more checks in the standard library
4 participants