rust-clippy/tests/ui/starts_ends_with.stderr
2018-12-10 08:22:07 +01:00

78 lines
2.7 KiB
Text

error: you should use the `starts_with` method
--> $DIR/starts_ends_with.rs:16:5
|
16 | "".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:17:5
|
17 | Some(' ') != "".chars().next();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: like this: `!"".starts_with(' ')`
error: you should use the `starts_with` method
--> $DIR/starts_ends_with.rs:22:8
|
22 | if s.chars().next().unwrap() == 'f' {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: like this: `s.starts_with('f')`
error: you should use the `ends_with` method
--> $DIR/starts_ends_with.rs:26:8
|
26 | if s.chars().next_back().unwrap() == '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:30:8
|
30 | if s.chars().last().unwrap() == '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' {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: like this: `!s.starts_with('f')`
error: you should use the `ends_with` method
--> $DIR/starts_ends_with.rs:38:8
|
38 | if s.chars().next_back().unwrap() != 'o' {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: like this: `!s.ends_with('o')`
error: you should use the `ends_with` method
--> $DIR/starts_ends_with.rs:42:8
|
42 | if s.chars().last().unwrap() != 'o' {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: like this: `!s.ends_with('o')`
error: you should use the `ends_with` method
--> $DIR/starts_ends_with.rs:50:5
|
50 | "".chars().last() == Some(' ');
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: like this: `"".ends_with(' ')`
error: you should use the `ends_with` method
--> $DIR/starts_ends_with.rs:51:5
|
51 | Some(' ') != "".chars().last();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: like this: `!"".ends_with(' ')`
error: you should use the `ends_with` method
--> $DIR/starts_ends_with.rs:52:5
|
52 | "".chars().next_back() == Some(' ');
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: like this: `"".ends_with(' ')`
error: you should use the `ends_with` method
--> $DIR/starts_ends_with.rs:53:5
|
53 | Some(' ') != "".chars().next_back();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: like this: `!"".ends_with(' ')`
error: aborting due to 12 previous errors