blob: 3ba447b3c36ba886d6b6bfcd080e1ffaaccb148a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
error: usage of `.chars().any(...)` to check if a char matches any from a string literal
--> tests/ui/string_lit_chars_any.rs:18:5
|
LL | "\\.+*?()|[]{}^$#&-~".chars().any(|x| x == c);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `-D clippy::string-lit-chars-any` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::string_lit_chars_any)]`
help: use `matches!(...)` instead
|
LL - "\\.+*?()|[]{}^$#&-~".chars().any(|x| x == c);
LL + matches!(c, '\\' | '.' | '+' | '*' | '?' | '(' | ')' | '|' | '[' | ']' | '{' | '}' | '^' | '$' | '#' | '&' | '-' | '~');
|
error: usage of `.chars().any(...)` to check if a char matches any from a string literal
--> tests/ui/string_lit_chars_any.rs:20:5
|
LL | r#"\.+*?()|[]{}^$#&-~"#.chars().any(|x| x == c);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
help: use `matches!(...)` instead
|
LL - r#"\.+*?()|[]{}^$#&-~"#.chars().any(|x| x == c);
LL + matches!(c, '\\' | '.' | '+' | '*' | '?' | '(' | ')' | '|' | '[' | ']' | '{' | '}' | '^' | '$' | '#' | '&' | '-' | '~');
|
error: usage of `.chars().any(...)` to check if a char matches any from a string literal
--> tests/ui/string_lit_chars_any.rs:22:5
|
LL | "\\.+*?()|[]{}^$#&-~".chars().any(|x| c == x);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
help: use `matches!(...)` instead
|
LL - "\\.+*?()|[]{}^$#&-~".chars().any(|x| c == x);
LL + matches!(c, '\\' | '.' | '+' | '*' | '?' | '(' | ')' | '|' | '[' | ']' | '{' | '}' | '^' | '$' | '#' | '&' | '-' | '~');
|
error: usage of `.chars().any(...)` to check if a char matches any from a string literal
--> tests/ui/string_lit_chars_any.rs:24:5
|
LL | r#"\.+*?()|[]{}^$#&-~"#.chars().any(|x| c == x);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
help: use `matches!(...)` instead
|
LL - r#"\.+*?()|[]{}^$#&-~"#.chars().any(|x| c == x);
LL + matches!(c, '\\' | '.' | '+' | '*' | '?' | '(' | ')' | '|' | '[' | ']' | '{' | '}' | '^' | '$' | '#' | '&' | '-' | '~');
|
error: usage of `.chars().any(...)` to check if a char matches any from a string literal
--> tests/ui/string_lit_chars_any.rs:27:5
|
LL | "\\.+*?()|[]{}^$#&-~".chars().any(|x| { x == c });
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
help: use `matches!(...)` instead
|
LL - "\\.+*?()|[]{}^$#&-~".chars().any(|x| { x == c });
LL + matches!(c, '\\' | '.' | '+' | '*' | '?' | '(' | ')' | '|' | '[' | ']' | '{' | '}' | '^' | '$' | '#' | '&' | '-' | '~');
|
error: aborting due to 5 previous errors
|