2023-07-31 21:53:53 +00:00
|
|
|
error: usage of `.chars().any(...)` to check if a char matches any from a string literal
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/string_lit_chars_any.rs:18:5
|
2023-07-31 21:53:53 +00:00
|
|
|
|
|
2023-08-24 19:32:12 +00:00
|
|
|
LL | "\\.+*?()|[]{}^$#&-~".chars().any(|x| x == c);
|
2023-07-31 21:53:53 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
= note: `-D clippy::string-lit-chars-any` implied by `-D warnings`
|
2023-08-01 12:02:21 +00:00
|
|
|
= help: to override `-D warnings` add `#[allow(clippy::string_lit_chars_any)]`
|
2023-07-31 21:53:53 +00:00
|
|
|
help: use `matches!(...)` instead
|
|
|
|
|
|
2023-08-24 19:32:12 +00:00
|
|
|
LL | matches!(c, '\\' | '.' | '+' | '*' | '?' | '(' | ')' | '|' | '[' | ']' | '{' | '}' | '^' | '$' | '#' | '&' | '-' | '~');
|
2023-07-31 21:53:53 +00:00
|
|
|
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
error: usage of `.chars().any(...)` to check if a char matches any from a string literal
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/string_lit_chars_any.rs:19:5
|
2023-07-31 21:53:53 +00:00
|
|
|
|
|
2023-08-24 19:32:12 +00:00
|
|
|
LL | r#"\.+*?()|[]{}^$#&-~"#.chars().any(|x| x == c);
|
2023-07-31 21:53:53 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: use `matches!(...)` instead
|
|
|
|
|
|
2023-08-24 19:32:12 +00:00
|
|
|
LL | matches!(c, '\\' | '.' | '+' | '*' | '?' | '(' | ')' | '|' | '[' | ']' | '{' | '}' | '^' | '$' | '#' | '&' | '-' | '~');
|
2023-07-31 21:53:53 +00:00
|
|
|
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
error: usage of `.chars().any(...)` to check if a char matches any from a string literal
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/string_lit_chars_any.rs:20:5
|
2023-07-31 21:53:53 +00:00
|
|
|
|
|
2023-08-24 19:32:12 +00:00
|
|
|
LL | "\\.+*?()|[]{}^$#&-~".chars().any(|x| c == x);
|
2023-07-31 21:53:53 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: use `matches!(...)` instead
|
|
|
|
|
|
2023-08-24 19:32:12 +00:00
|
|
|
LL | matches!(c, '\\' | '.' | '+' | '*' | '?' | '(' | ')' | '|' | '[' | ']' | '{' | '}' | '^' | '$' | '#' | '&' | '-' | '~');
|
2023-07-31 21:53:53 +00:00
|
|
|
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
error: usage of `.chars().any(...)` to check if a char matches any from a string literal
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/string_lit_chars_any.rs:21:5
|
2023-07-31 21:53:53 +00:00
|
|
|
|
|
2023-08-24 19:32:12 +00:00
|
|
|
LL | r#"\.+*?()|[]{}^$#&-~"#.chars().any(|x| c == x);
|
2023-07-31 21:53:53 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: use `matches!(...)` instead
|
|
|
|
|
|
2023-08-24 19:32:12 +00:00
|
|
|
LL | matches!(c, '\\' | '.' | '+' | '*' | '?' | '(' | ')' | '|' | '[' | ']' | '{' | '}' | '^' | '$' | '#' | '&' | '-' | '~');
|
2023-07-31 21:53:53 +00:00
|
|
|
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
error: usage of `.chars().any(...)` to check if a char matches any from a string literal
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/string_lit_chars_any.rs:23:5
|
2023-07-31 21:53:53 +00:00
|
|
|
|
|
2023-08-24 19:32:12 +00:00
|
|
|
LL | "\\.+*?()|[]{}^$#&-~".chars().any(|x| { x == c });
|
2023-07-31 21:53:53 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: use `matches!(...)` instead
|
|
|
|
|
|
2023-08-24 19:32:12 +00:00
|
|
|
LL | matches!(c, '\\' | '.' | '+' | '*' | '?' | '(' | ')' | '|' | '[' | ']' | '{' | '}' | '^' | '$' | '#' | '&' | '-' | '~');
|
2023-07-31 21:53:53 +00:00
|
|
|
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
error: aborting due to 5 previous errors
|
|
|
|
|