-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Add manual_is_ascii_check
lint
#9765
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
Conversation
684f89c
to
2ef025b
Compare
That is totally fine, my comment in the issue was more related to cases like: assert(matches!(c, 'a'..='z') || matches!(c, 'A'..='Z')) Which would require more effort with probably little benefit. Adding all |
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.
The implementation and created suggestions are really solid. Awesome work! I've left some small comments, but all of them should be simple to fix.
@xFrednet Thank you for review, I learned a lot! |
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, this implementation looks really solid to me. The test covers all cases I can think of. Thank you very much!
Before we merge, could you squash the update commits into one? You're welcome to reach out, if you need any help with the squashing.
modify fix: allow unused in test code fix: types in doc comment Update clippy_lints/src/manual_is_ascii_check.rs Co-authored-by: Fridtjof Stoldt <[email protected]> Update clippy_lints/src/manual_is_ascii_check.rs Co-authored-by: Fridtjof Stoldt <[email protected]> Update clippy_lints/src/manual_is_ascii_check.rs Co-authored-by: Fridtjof Stoldt <[email protected]> fix ui test result fix: unnecessary format! chore: apply feedbacks * check msrvs also for const fn * check applicability manually * modify documents
0b0e0ef
to
e4540ad
Compare
squashed, and confirmed it won't change during the commit. https://github.com/rust-lang/rust-clippy/compare/0b0e0ef191994360dc647dd8fa6f3a7967a2621d..e4540ad65fa14ceebd5145ab771fe4918d170bf1 |
This version looks good to me, thank you for the update! @bors r+ |
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
Addresses #9290
This PR adds new lint
manual_is_ascii_check
, which detects comparison with ascii ranges usingmatches!
macros.As I mentioned as following in the Issue;
However during writing first version, I was thinking that the changes to support alphabetic and digits will be small patch, so I made a single PR in hope review cost can be reduced.
changelog: add new lint [
manual_is_ascii_check
]r? @xFrednet