]> git.lizzy.rs Git - rust.git/commit
Auto merge of #9765 - koka831:feat/manual_is_ascii_check, r=xFrednet
authorbors <bors@rust-lang.org>
Tue, 8 Nov 2022 09:20:52 +0000 (09:20 +0000)
committerbors <bors@rust-lang.org>
Tue, 8 Nov 2022 09:20:52 +0000 (09:20 +0000)
commit4abe815729847303c9729df76d0f3166fe7ae2fb
tree01209c7ae9e9857c6e7b2dad9889a6173012af23
parent5857a0174249bd5a9c0daeb4a9fde4a3601d7303
parente4540ad65fa14ceebd5145ab771fe4918d170bf1
Auto merge of #9765 - koka831:feat/manual_is_ascii_check, r=xFrednet

Add `manual_is_ascii_check` lint

Addresses https://github.com/rust-lang/rust-clippy/issues/9290

This PR adds new lint `manual_is_ascii_check`, which detects comparison with ascii ranges using `matches!` macros.

As I mentioned as following in the Issue;
> Yes, that's true. we'll start small and then grow it.
> So I'll try to handle matches! macro with single range as suggested above.

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`
CHANGELOG.md
clippy_lints/src/declared_lints.rs
clippy_lints/src/lib.rs