error: single-character string constant used as pattern
- --> $DIR/single_char_pattern.rs:5:13
- |
-5 | x.split("x");
- | --------^^^- help: try using a char instead: `x.split('x')`
- |
- = note: `-D single-char-pattern` implied by `-D warnings`
+ --> $DIR/single_char_pattern.rs:14: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:31: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:32: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:22:16
+ --> $DIR/single_char_pattern.rs:33:17
|
-22 | x.contains("x");
- | -----------^^^- help: try using a char instead: `x.contains('x')`
+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:23:19
+ --> $DIR/single_char_pattern.rs:34:12
|
-23 | x.starts_with("x");
- | --------------^^^- help: try using a char instead: `x.starts_with('x')`
+LL | x.find("x");
+ | ^^^ help: try using a char instead: `'x'`
error: single-character string constant used as pattern
- --> $DIR/single_char_pattern.rs:24:17
+ --> $DIR/single_char_pattern.rs:35:13
|
-24 | x.ends_with("x");
- | ------------^^^- help: try using a char instead: `x.ends_with('x')`
+LL | x.rfind("x");
+ | ^^^ help: try using a char instead: `'x'`
error: single-character string constant used as pattern
- --> $DIR/single_char_pattern.rs:25:12
+ --> $DIR/single_char_pattern.rs:36:14
|
-25 | x.find("x");
- | -------^^^- help: try using a char instead: `x.find('x')`
+LL | x.rsplit("x");
+ | ^^^ help: try using a char instead: `'x'`
error: single-character string constant used as pattern
- --> $DIR/single_char_pattern.rs:26:13
+ --> $DIR/single_char_pattern.rs:37:24
|
-26 | x.rfind("x");
- | --------^^^- help: try using a char instead: `x.rfind('x')`
+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:27:14
+ --> $DIR/single_char_pattern.rs:38:25
|
-27 | x.rsplit("x");
- | ---------^^^- help: try using a char instead: `x.rsplit('x')`
+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:28:24
+ --> $DIR/single_char_pattern.rs:39:17
|
-28 | x.split_terminator("x");
- | -------------------^^^- help: try using a char instead: `x.split_terminator('x')`
+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:29:25
+ --> $DIR/single_char_pattern.rs:40:18
|
-29 | x.rsplit_terminator("x");
- | --------------------^^^- help: try using a char instead: `x.rsplit_terminator('x')`
+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:30:17
+ --> $DIR/single_char_pattern.rs:41:15
|
-30 | x.splitn(0, "x");
- | ------------^^^- help: try using a char instead: `x.splitn(0, 'x')`
+LL | x.matches("x");
+ | ^^^ help: try using a char instead: `'x'`
error: single-character string constant used as pattern
- --> $DIR/single_char_pattern.rs:31:18
+ --> $DIR/single_char_pattern.rs:42:16
|
-31 | x.rsplitn(0, "x");
- | -------------^^^- help: try using a char instead: `x.rsplitn(0, 'x')`
+LL | x.rmatches("x");
+ | ^^^ help: try using a char instead: `'x'`
error: single-character string constant used as pattern
- --> $DIR/single_char_pattern.rs:32:15
+ --> $DIR/single_char_pattern.rs:43:21
|
-32 | x.matches("x");
- | ----------^^^- help: try using a char instead: `x.matches('x')`
+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:33:16
+ --> $DIR/single_char_pattern.rs:44:22
|
-33 | x.rmatches("x");
- | -----------^^^- help: try using a char instead: `x.rmatches('x')`
+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:34:21
+ --> $DIR/single_char_pattern.rs:45:26
|
-34 | x.match_indices("x");
- | ----------------^^^- help: try using a char instead: `x.match_indices('x')`
+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:35:22
+ --> $DIR/single_char_pattern.rs:46:24
|
-35 | x.rmatch_indices("x");
- | -----------------^^^- help: try using a char instead: `x.rmatch_indices('x')`
+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:36:25
+ --> $DIR/single_char_pattern.rs:48:13
|
-36 | x.trim_left_matches("x");
- | --------------------^^^- help: try using a char instead: `x.trim_left_matches('x')`
+LL | x.split("/n");
+ | ^^^^ help: try using a char instead: `'/n'`
error: single-character string constant used as pattern
- --> $DIR/single_char_pattern.rs:37:26
+ --> $DIR/single_char_pattern.rs:53:31
|
-37 | x.trim_right_matches("x");
- | ---------------------^^^- help: try using a char instead: `x.trim_right_matches('x')`
+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:39:13
+ --> $DIR/single_char_pattern.rs:54:19
|
-39 | x.split("/n");
- | --------^^^^- help: try using a char instead: `x.split('/n')`
+LL | x.starts_with("/x03"); // issue #2996
+ | ^^^^^^ help: try using a char instead: `'/x03'`
-error: aborting due to 18 previous errors
+error: aborting due to 20 previous errors