Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rustup: unused trim result #3727

Merged
merged 1 commit into from Jan 31, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions tests/ui/single_char_pattern.fixed
@@ -1,5 +1,7 @@
// run-rustfix

#![allow(unused_must_use)]

use std::collections::HashSet;

fn main() {
Expand Down
2 changes: 2 additions & 0 deletions tests/ui/single_char_pattern.rs
@@ -1,5 +1,7 @@
// run-rustfix

#![allow(unused_must_use)]

use std::collections::HashSet;

fn main() {
Expand Down
40 changes: 20 additions & 20 deletions tests/ui/single_char_pattern.stderr
@@ -1,121 +1,121 @@
error: single-character string constant used as pattern
--> $DIR/single_char_pattern.rs:7:13
--> $DIR/single_char_pattern.rs:9:13
|
LL | x.split("x");
| ^^^ help: try using a char instead: `'x'`
|
= note: `-D clippy::single-char-pattern` implied by `-D warnings`

error: single-character string constant used as pattern
--> $DIR/single_char_pattern.rs:24:16
--> $DIR/single_char_pattern.rs:26:16
|
LL | x.contains("x");
| ^^^ help: try using a char instead: `'x'`

error: single-character string constant used as pattern
--> $DIR/single_char_pattern.rs:25:19
--> $DIR/single_char_pattern.rs:27:19
|
LL | x.starts_with("x");
| ^^^ help: try using a char instead: `'x'`

error: single-character string constant used as pattern
--> $DIR/single_char_pattern.rs:26:17
--> $DIR/single_char_pattern.rs:28:17
|
LL | x.ends_with("x");
| ^^^ help: try using a char instead: `'x'`

error: single-character string constant used as pattern
--> $DIR/single_char_pattern.rs:27:12
--> $DIR/single_char_pattern.rs:29:12
|
LL | x.find("x");
| ^^^ help: try using a char instead: `'x'`

error: single-character string constant used as pattern
--> $DIR/single_char_pattern.rs:28:13
--> $DIR/single_char_pattern.rs:30:13
|
LL | x.rfind("x");
| ^^^ help: try using a char instead: `'x'`

error: single-character string constant used as pattern
--> $DIR/single_char_pattern.rs:29:14
--> $DIR/single_char_pattern.rs:31:14
|
LL | x.rsplit("x");
| ^^^ help: try using a char instead: `'x'`

error: single-character string constant used as pattern
--> $DIR/single_char_pattern.rs:30:24
--> $DIR/single_char_pattern.rs:32:24
|
LL | x.split_terminator("x");
| ^^^ help: try using a char instead: `'x'`

error: single-character string constant used as pattern
--> $DIR/single_char_pattern.rs:31:25
--> $DIR/single_char_pattern.rs:33:25
|
LL | x.rsplit_terminator("x");
| ^^^ help: try using a char instead: `'x'`

error: single-character string constant used as pattern
--> $DIR/single_char_pattern.rs:32:17
--> $DIR/single_char_pattern.rs:34:17
|
LL | x.splitn(0, "x");
| ^^^ help: try using a char instead: `'x'`

error: single-character string constant used as pattern
--> $DIR/single_char_pattern.rs:33:18
--> $DIR/single_char_pattern.rs:35:18
|
LL | x.rsplitn(0, "x");
| ^^^ help: try using a char instead: `'x'`

error: single-character string constant used as pattern
--> $DIR/single_char_pattern.rs:34:15
--> $DIR/single_char_pattern.rs:36:15
|
LL | x.matches("x");
| ^^^ help: try using a char instead: `'x'`

error: single-character string constant used as pattern
--> $DIR/single_char_pattern.rs:35:16
--> $DIR/single_char_pattern.rs:37:16
|
LL | x.rmatches("x");
| ^^^ help: try using a char instead: `'x'`

error: single-character string constant used as pattern
--> $DIR/single_char_pattern.rs:36:21
--> $DIR/single_char_pattern.rs:38:21
|
LL | x.match_indices("x");
| ^^^ help: try using a char instead: `'x'`

error: single-character string constant used as pattern
--> $DIR/single_char_pattern.rs:37:22
--> $DIR/single_char_pattern.rs:39:22
|
LL | x.rmatch_indices("x");
| ^^^ help: try using a char instead: `'x'`

error: single-character string constant used as pattern
--> $DIR/single_char_pattern.rs:38:26
--> $DIR/single_char_pattern.rs:40:26
|
LL | x.trim_start_matches("x");
| ^^^ help: try using a char instead: `'x'`

error: single-character string constant used as pattern
--> $DIR/single_char_pattern.rs:39:24
--> $DIR/single_char_pattern.rs:41:24
|
LL | x.trim_end_matches("x");
| ^^^ help: try using a char instead: `'x'`

error: single-character string constant used as pattern
--> $DIR/single_char_pattern.rs:41:13
--> $DIR/single_char_pattern.rs:43:13
|
LL | x.split("/n");
| ^^^^ help: try using a char instead: `'/n'`

error: single-character string constant used as pattern
--> $DIR/single_char_pattern.rs:46:31
--> $DIR/single_char_pattern.rs:48:31
|
LL | x.replace(";", ",").split(","); // issue #2978
| ^^^ help: try using a char instead: `','`

error: single-character string constant used as pattern
--> $DIR/single_char_pattern.rs:47:19
--> $DIR/single_char_pattern.rs:49:19
|
LL | x.starts_with("/x03"); // issue #2996
| ^^^^^^ help: try using a char instead: `'/x03'`
Expand Down