blob: bcb38f2beb7b342e0ac14e3df5df3dfe31415823 (
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
|
error: you should use the `starts_with` method
--> tests/ui/starts_ends_with.rs:7:5
|
LL | "".chars().next() == Some(' ');
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: like this: `"".starts_with(' ')`
|
= note: `-D clippy::chars-next-cmp` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::chars_next_cmp)]`
error: you should use the `starts_with` method
--> tests/ui/starts_ends_with.rs:9:5
|
LL | Some(' ') != "".chars().next();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: like this: `!"".starts_with(' ')`
error: you should use the `starts_with` method
--> tests/ui/starts_ends_with.rs:13:5
|
LL | "".chars().next() == Some('\n');
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: like this: `"".starts_with('\n')`
error: you should use the `starts_with` method
--> tests/ui/starts_ends_with.rs:15:5
|
LL | Some('\n') != "".chars().next();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: like this: `!"".starts_with('\n')`
error: you should use the `starts_with` method
--> tests/ui/starts_ends_with.rs:21:8
|
LL | if s.chars().next().unwrap() == 'f' {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: like this: `s.starts_with('f')`
error: you should use the `ends_with` method
--> tests/ui/starts_ends_with.rs:26:8
|
LL | if s.chars().next_back().unwrap() == 'o' {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: like this: `s.ends_with('o')`
|
= note: `-D clippy::chars-last-cmp` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::chars_last_cmp)]`
error: you should use the `ends_with` method
--> tests/ui/starts_ends_with.rs:31:8
|
LL | if s.chars().last().unwrap() == 'o' {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: like this: `s.ends_with('o')`
error: you should use the `starts_with` method
--> tests/ui/starts_ends_with.rs:36:8
|
LL | if s.chars().next().unwrap() != 'f' {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: like this: `!s.starts_with('f')`
error: you should use the `ends_with` method
--> tests/ui/starts_ends_with.rs:41:8
|
LL | if s.chars().next_back().unwrap() != 'o' {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: like this: `!s.ends_with('o')`
error: you should use the `ends_with` method
--> tests/ui/starts_ends_with.rs:46:8
|
LL | if s.chars().last().unwrap() != '\n' {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: like this: `!s.ends_with('\n')`
error: you should use the `ends_with` method
--> tests/ui/starts_ends_with.rs:55:5
|
LL | "".chars().last() == Some(' ');
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: like this: `"".ends_with(' ')`
error: you should use the `ends_with` method
--> tests/ui/starts_ends_with.rs:57:5
|
LL | Some(' ') != "".chars().last();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: like this: `!"".ends_with(' ')`
error: you should use the `ends_with` method
--> tests/ui/starts_ends_with.rs:59:5
|
LL | "".chars().next_back() == Some(' ');
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: like this: `"".ends_with(' ')`
error: you should use the `ends_with` method
--> tests/ui/starts_ends_with.rs:61:5
|
LL | Some(' ') != "".chars().next_back();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: like this: `!"".ends_with(' ')`
error: you should use the `ends_with` method
--> tests/ui/starts_ends_with.rs:65:5
|
LL | "".chars().last() == Some('\n');
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: like this: `"".ends_with('\n')`
error: you should use the `ends_with` method
--> tests/ui/starts_ends_with.rs:67:5
|
LL | Some('\n') != "".chars().last();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: like this: `!"".ends_with('\n')`
error: aborting due to 16 previous errors
|