mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-24 13:43:17 +00:00
e4540ad65f
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 <xFrednet@gmail.com> Update clippy_lints/src/manual_is_ascii_check.rs Co-authored-by: Fridtjof Stoldt <xFrednet@gmail.com> Update clippy_lints/src/manual_is_ascii_check.rs Co-authored-by: Fridtjof Stoldt <xFrednet@gmail.com> fix ui test result fix: unnecessary format! chore: apply feedbacks * check msrvs also for const fn * check applicability manually * modify documents
70 lines
2.5 KiB
Text
70 lines
2.5 KiB
Text
error: manual check for common ascii range
|
|
--> $DIR/manual_is_ascii_check.rs:8:13
|
|
|
|
|
LL | assert!(matches!('x', 'a'..='z'));
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `'x'.is_ascii_lowercase()`
|
|
|
|
|
= note: `-D clippy::manual-is-ascii-check` implied by `-D warnings`
|
|
|
|
error: manual check for common ascii range
|
|
--> $DIR/manual_is_ascii_check.rs:9:13
|
|
|
|
|
LL | assert!(matches!('X', 'A'..='Z'));
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `'X'.is_ascii_uppercase()`
|
|
|
|
error: manual check for common ascii range
|
|
--> $DIR/manual_is_ascii_check.rs:10:13
|
|
|
|
|
LL | assert!(matches!(b'x', b'a'..=b'z'));
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `b'x'.is_ascii_lowercase()`
|
|
|
|
error: manual check for common ascii range
|
|
--> $DIR/manual_is_ascii_check.rs:11:13
|
|
|
|
|
LL | assert!(matches!(b'X', b'A'..=b'Z'));
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `b'X'.is_ascii_uppercase()`
|
|
|
|
error: manual check for common ascii range
|
|
--> $DIR/manual_is_ascii_check.rs:14:13
|
|
|
|
|
LL | assert!(matches!(num, '0'..='9'));
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `num.is_ascii_digit()`
|
|
|
|
error: manual check for common ascii range
|
|
--> $DIR/manual_is_ascii_check.rs:15:13
|
|
|
|
|
LL | assert!(matches!(b'1', b'0'..=b'9'));
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `b'1'.is_ascii_digit()`
|
|
|
|
error: manual check for common ascii range
|
|
--> $DIR/manual_is_ascii_check.rs:16:13
|
|
|
|
|
LL | assert!(matches!('x', 'A'..='Z' | 'a'..='z'));
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `'x'.is_ascii_alphabetic()`
|
|
|
|
error: manual check for common ascii range
|
|
--> $DIR/manual_is_ascii_check.rs:32:13
|
|
|
|
|
LL | assert!(matches!(b'1', b'0'..=b'9'));
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `b'1'.is_ascii_digit()`
|
|
|
|
error: manual check for common ascii range
|
|
--> $DIR/manual_is_ascii_check.rs:33:13
|
|
|
|
|
LL | assert!(matches!('X', 'A'..='Z'));
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `'X'.is_ascii_uppercase()`
|
|
|
|
error: manual check for common ascii range
|
|
--> $DIR/manual_is_ascii_check.rs:34:13
|
|
|
|
|
LL | assert!(matches!('x', 'A'..='Z' | 'a'..='z'));
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `'x'.is_ascii_alphabetic()`
|
|
|
|
error: manual check for common ascii range
|
|
--> $DIR/manual_is_ascii_check.rs:44:23
|
|
|
|
|
LL | const FOO: bool = matches!('x', '0'..='9');
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `'x'.is_ascii_digit()`
|
|
|
|
error: aborting due to 11 previous errors
|
|
|