rust-clippy/tests/ui/manual_is_ascii_check.stderr

107 lines
3.8 KiB
Text
Raw Normal View History

error: manual check for common ascii range
--> $DIR/manual_is_ascii_check.rs:7: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:8: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:9: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:10: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:13: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:14: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:15:13
|
LL | assert!(matches!('x', 'A'..='Z' | 'a'..='z'));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `'x'.is_ascii_alphabetic()`
error: manual check for common ascii range
2022-12-12 10:58:02 +00:00
--> $DIR/manual_is_ascii_check.rs:19:13
2022-12-09 03:40:50 +00:00
|
LL | assert!((b'0'..=b'9').contains(&b'0'));
2022-12-13 02:50:49 +00:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `b'0'.is_ascii_digit()`
2022-12-09 03:40:50 +00:00
error: manual check for common ascii range
2022-12-12 10:58:02 +00:00
--> $DIR/manual_is_ascii_check.rs:20:13
|
LL | assert!((b'a'..=b'z').contains(&b'a'));
2022-12-13 02:50:49 +00:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `b'a'.is_ascii_lowercase()`
2022-12-12 10:58:02 +00:00
error: manual check for common ascii range
--> $DIR/manual_is_ascii_check.rs:21:13
|
LL | assert!((b'A'..=b'Z').contains(&b'A'));
2022-12-13 02:50:49 +00:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `b'A'.is_ascii_uppercase()`
2022-12-12 10:58:02 +00:00
error: manual check for common ascii range
--> $DIR/manual_is_ascii_check.rs:23:13
|
LL | assert!(('0'..='9').contains(&'0'));
2022-12-13 02:50:49 +00:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `'0'.is_ascii_digit()`
2022-12-12 10:58:02 +00:00
error: manual check for common ascii range
--> $DIR/manual_is_ascii_check.rs:24:13
|
LL | assert!(('a'..='z').contains(&'a'));
2022-12-13 02:50:49 +00:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `'a'.is_ascii_lowercase()`
2022-12-12 10:58:02 +00:00
error: manual check for common ascii range
--> $DIR/manual_is_ascii_check.rs:25:13
|
LL | assert!(('A'..='Z').contains(&'A'));
2022-12-13 02:50:49 +00:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `'A'.is_ascii_uppercase()`
2022-12-12 10:58:02 +00:00
error: manual check for common ascii range
--> $DIR/manual_is_ascii_check.rs:37:13
|
LL | assert!(matches!(b'1', b'0'..=b'9'));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `b'1'.is_ascii_digit()`
error: manual check for common ascii range
2022-12-12 10:58:02 +00:00
--> $DIR/manual_is_ascii_check.rs:38:13
|
LL | assert!(matches!('X', 'A'..='Z'));
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `'X'.is_ascii_uppercase()`
error: manual check for common ascii range
2022-12-12 10:58:02 +00:00
--> $DIR/manual_is_ascii_check.rs:39:13
|
LL | assert!(matches!('x', 'A'..='Z' | 'a'..='z'));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `'x'.is_ascii_alphabetic()`
error: manual check for common ascii range
2022-12-12 10:58:02 +00:00
--> $DIR/manual_is_ascii_check.rs:49:23
|
LL | const FOO: bool = matches!('x', '0'..='9');
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `'x'.is_ascii_digit()`
2022-12-12 10:58:02 +00:00
error: aborting due to 17 previous errors