mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-28 07:30:57 +00:00
78 lines
2.8 KiB
Text
78 lines
2.8 KiB
Text
error: you should use the `starts_with` method
|
|
--> $DIR/starts_ends_with.rs:19:5
|
|
|
|
|
19 | "".chars().next() == Some(' ');
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: like this: `"".starts_with(' ')`
|
|
|
|
|
= note: `-D clippy::chars-next-cmp` implied by `-D warnings`
|
|
|
|
error: you should use the `starts_with` method
|
|
--> $DIR/starts_ends_with.rs:20:5
|
|
|
|
|
20 | Some(' ') != "".chars().next();
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: like this: `!"".starts_with(' ')`
|
|
|
|
error: you should use the `starts_with` method
|
|
--> $DIR/starts_ends_with.rs:25:8
|
|
|
|
|
25 | if s.chars().next().unwrap() == 'f' { // s.starts_with('f')
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: like this: `s.starts_with('f')`
|
|
|
|
error: you should use the `ends_with` method
|
|
--> $DIR/starts_ends_with.rs:28:8
|
|
|
|
|
28 | if s.chars().next_back().unwrap() == 'o' { // s.ends_with('o')
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: like this: `s.ends_with('o')`
|
|
|
|
|
= note: `-D clippy::chars-last-cmp` implied by `-D warnings`
|
|
|
|
error: you should use the `ends_with` method
|
|
--> $DIR/starts_ends_with.rs:31:8
|
|
|
|
|
31 | if s.chars().last().unwrap() == 'o' { // s.ends_with('o')
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: like this: `s.ends_with('o')`
|
|
|
|
error: you should use the `starts_with` method
|
|
--> $DIR/starts_ends_with.rs:34:8
|
|
|
|
|
34 | if s.chars().next().unwrap() != 'f' { // !s.starts_with('f')
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: like this: `!s.starts_with('f')`
|
|
|
|
error: you should use the `ends_with` method
|
|
--> $DIR/starts_ends_with.rs:37:8
|
|
|
|
|
37 | if s.chars().next_back().unwrap() != 'o' { // !s.ends_with('o')
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: like this: `!s.ends_with('o')`
|
|
|
|
error: you should use the `ends_with` method
|
|
--> $DIR/starts_ends_with.rs:40:8
|
|
|
|
|
40 | if s.chars().last().unwrap() != 'o' { // !s.ends_with('o')
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: like this: `!s.ends_with('o')`
|
|
|
|
error: you should use the `ends_with` method
|
|
--> $DIR/starts_ends_with.rs:47:5
|
|
|
|
|
47 | "".chars().last() == Some(' ');
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: like this: `"".ends_with(' ')`
|
|
|
|
error: you should use the `ends_with` method
|
|
--> $DIR/starts_ends_with.rs:48:5
|
|
|
|
|
48 | Some(' ') != "".chars().last();
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: like this: `!"".ends_with(' ')`
|
|
|
|
error: you should use the `ends_with` method
|
|
--> $DIR/starts_ends_with.rs:49:5
|
|
|
|
|
49 | "".chars().next_back() == Some(' ');
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: like this: `"".ends_with(' ')`
|
|
|
|
error: you should use the `ends_with` method
|
|
--> $DIR/starts_ends_with.rs:50:5
|
|
|
|
|
50 | Some(' ') != "".chars().next_back();
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: like this: `!"".ends_with(' ')`
|
|
|
|
error: aborting due to 12 previous errors
|
|
|