2017-10-09 23:00:47 -05:00
|
|
|
|
error: single-character string constant used as pattern
|
2024-02-27 08:25:18 -06:00
|
|
|
|
--> tests/ui/single_char_pattern.rs:7:13
|
2018-10-06 11:18:06 -05:00
|
|
|
|
|
|
2018-12-27 09:57:55 -06:00
|
|
|
|
LL | x.split("x");
|
2024-01-25 12:17:36 -06:00
|
|
|
|
| ^^^ help: consider using a `char`: `'x'`
|
2018-10-06 11:18:06 -05:00
|
|
|
|
|
|
|
|
|
|
= note: `-D clippy::single-char-pattern` implied by `-D warnings`
|
2023-08-01 07:02:21 -05:00
|
|
|
|
= help: to override `-D warnings` add `#[allow(clippy::single_char_pattern)]`
|
2017-10-09 23:00:47 -05:00
|
|
|
|
|
|
|
|
|
error: single-character string constant used as pattern
|
2024-02-27 08:25:18 -06:00
|
|
|
|
--> tests/ui/single_char_pattern.rs:13:13
|
2020-11-05 07:29:48 -06:00
|
|
|
|
|
|
|
|
|
|
LL | x.split("ß");
|
2024-01-25 12:17:36 -06:00
|
|
|
|
| ^^^ help: consider using a `char`: `'ß'`
|
2020-11-05 07:29:48 -06:00
|
|
|
|
|
|
|
|
|
error: single-character string constant used as pattern
|
2024-02-27 08:25:18 -06:00
|
|
|
|
--> tests/ui/single_char_pattern.rs:14:13
|
2020-11-05 07:29:48 -06:00
|
|
|
|
|
|
|
|
|
|
LL | x.split("ℝ");
|
2024-01-25 12:17:36 -06:00
|
|
|
|
| ^^^ help: consider using a `char`: `'ℝ'`
|
2020-11-05 07:29:48 -06:00
|
|
|
|
|
|
|
|
|
error: single-character string constant used as pattern
|
2024-02-27 08:25:18 -06:00
|
|
|
|
--> tests/ui/single_char_pattern.rs:15:13
|
2020-11-05 07:29:48 -06:00
|
|
|
|
|
|
|
|
|
|
LL | x.split("💣");
|
2024-01-25 12:17:36 -06:00
|
|
|
|
| ^^^^ help: consider using a `char`: `'💣'`
|
2020-11-05 07:29:48 -06:00
|
|
|
|
|
|
|
|
|
error: single-character string constant used as pattern
|
2024-02-27 08:25:18 -06:00
|
|
|
|
--> tests/ui/single_char_pattern.rs:18:23
|
2021-12-06 05:33:31 -06:00
|
|
|
|
|
|
|
|
|
|
LL | x.split_inclusive("x");
|
2024-01-25 12:17:36 -06:00
|
|
|
|
| ^^^ help: consider using a `char`: `'x'`
|
2021-12-06 05:33:31 -06:00
|
|
|
|
|
|
|
|
|
error: single-character string constant used as pattern
|
2024-02-27 08:25:18 -06:00
|
|
|
|
--> tests/ui/single_char_pattern.rs:19:16
|
2017-10-09 23:00:47 -05:00
|
|
|
|
|
|
2018-12-27 09:57:55 -06:00
|
|
|
|
LL | x.contains("x");
|
2024-01-25 12:17:36 -06:00
|
|
|
|
| ^^^ help: consider using a `char`: `'x'`
|
2017-10-09 23:00:47 -05:00
|
|
|
|
|
|
|
|
|
error: single-character string constant used as pattern
|
2024-02-27 08:25:18 -06:00
|
|
|
|
--> tests/ui/single_char_pattern.rs:20:19
|
2017-10-09 23:00:47 -05:00
|
|
|
|
|
|
2018-12-27 09:57:55 -06:00
|
|
|
|
LL | x.starts_with("x");
|
2024-01-25 12:17:36 -06:00
|
|
|
|
| ^^^ help: consider using a `char`: `'x'`
|
2017-10-09 23:00:47 -05:00
|
|
|
|
|
|
|
|
|
error: single-character string constant used as pattern
|
2024-02-27 08:25:18 -06:00
|
|
|
|
--> tests/ui/single_char_pattern.rs:21:17
|
2017-10-09 23:00:47 -05:00
|
|
|
|
|
|
2018-12-27 09:57:55 -06:00
|
|
|
|
LL | x.ends_with("x");
|
2024-01-25 12:17:36 -06:00
|
|
|
|
| ^^^ help: consider using a `char`: `'x'`
|
2017-10-09 23:00:47 -05:00
|
|
|
|
|
|
|
|
|
error: single-character string constant used as pattern
|
2024-02-27 08:25:18 -06:00
|
|
|
|
--> tests/ui/single_char_pattern.rs:22:12
|
2017-10-09 23:00:47 -05:00
|
|
|
|
|
|
2018-12-27 09:57:55 -06:00
|
|
|
|
LL | x.find("x");
|
2024-01-25 12:17:36 -06:00
|
|
|
|
| ^^^ help: consider using a `char`: `'x'`
|
2017-10-09 23:00:47 -05:00
|
|
|
|
|
|
|
|
|
error: single-character string constant used as pattern
|
2024-02-27 08:25:18 -06:00
|
|
|
|
--> tests/ui/single_char_pattern.rs:23:13
|
2017-10-09 23:00:47 -05:00
|
|
|
|
|
|
2018-12-27 09:57:55 -06:00
|
|
|
|
LL | x.rfind("x");
|
2024-01-25 12:17:36 -06:00
|
|
|
|
| ^^^ help: consider using a `char`: `'x'`
|
2017-10-09 23:00:47 -05:00
|
|
|
|
|
|
|
|
|
error: single-character string constant used as pattern
|
2024-02-27 08:25:18 -06:00
|
|
|
|
--> tests/ui/single_char_pattern.rs:24:14
|
2017-10-09 23:00:47 -05:00
|
|
|
|
|
|
2018-12-27 09:57:55 -06:00
|
|
|
|
LL | x.rsplit("x");
|
2024-01-25 12:17:36 -06:00
|
|
|
|
| ^^^ help: consider using a `char`: `'x'`
|
2017-10-09 23:00:47 -05:00
|
|
|
|
|
|
|
|
|
error: single-character string constant used as pattern
|
2024-02-27 08:25:18 -06:00
|
|
|
|
--> tests/ui/single_char_pattern.rs:25:24
|
2017-10-09 23:00:47 -05:00
|
|
|
|
|
|
2018-12-27 09:57:55 -06:00
|
|
|
|
LL | x.split_terminator("x");
|
2024-01-25 12:17:36 -06:00
|
|
|
|
| ^^^ help: consider using a `char`: `'x'`
|
2017-10-09 23:00:47 -05:00
|
|
|
|
|
|
|
|
|
error: single-character string constant used as pattern
|
2024-02-27 08:25:18 -06:00
|
|
|
|
--> tests/ui/single_char_pattern.rs:26:25
|
2017-10-09 23:00:47 -05:00
|
|
|
|
|
|
2018-12-27 09:57:55 -06:00
|
|
|
|
LL | x.rsplit_terminator("x");
|
2024-01-25 12:17:36 -06:00
|
|
|
|
| ^^^ help: consider using a `char`: `'x'`
|
2017-10-09 23:00:47 -05:00
|
|
|
|
|
|
|
|
|
error: single-character string constant used as pattern
|
2024-02-27 08:25:18 -06:00
|
|
|
|
--> tests/ui/single_char_pattern.rs:27:17
|
2017-10-09 23:00:47 -05:00
|
|
|
|
|
|
2021-06-03 01:41:37 -05:00
|
|
|
|
LL | x.splitn(2, "x");
|
2024-01-25 12:17:36 -06:00
|
|
|
|
| ^^^ help: consider using a `char`: `'x'`
|
2017-10-09 23:00:47 -05:00
|
|
|
|
|
|
|
|
|
error: single-character string constant used as pattern
|
2024-02-27 08:25:18 -06:00
|
|
|
|
--> tests/ui/single_char_pattern.rs:28:18
|
2017-10-09 23:00:47 -05:00
|
|
|
|
|
|
2021-06-03 01:41:37 -05:00
|
|
|
|
LL | x.rsplitn(2, "x");
|
2024-01-25 12:17:36 -06:00
|
|
|
|
| ^^^ help: consider using a `char`: `'x'`
|
2017-10-09 23:00:47 -05:00
|
|
|
|
|
|
|
|
|
error: single-character string constant used as pattern
|
2024-02-27 08:25:18 -06:00
|
|
|
|
--> tests/ui/single_char_pattern.rs:29:18
|
2021-12-06 05:33:31 -06:00
|
|
|
|
|
|
|
|
|
|
LL | x.split_once("x");
|
2024-01-25 12:17:36 -06:00
|
|
|
|
| ^^^ help: consider using a `char`: `'x'`
|
2021-12-06 05:33:31 -06:00
|
|
|
|
|
|
|
|
|
error: single-character string constant used as pattern
|
2024-02-27 08:25:18 -06:00
|
|
|
|
--> tests/ui/single_char_pattern.rs:30:19
|
2021-12-06 05:33:31 -06:00
|
|
|
|
|
|
|
|
|
|
LL | x.rsplit_once("x");
|
2024-01-25 12:17:36 -06:00
|
|
|
|
| ^^^ help: consider using a `char`: `'x'`
|
2021-12-06 05:33:31 -06:00
|
|
|
|
|
|
|
|
|
error: single-character string constant used as pattern
|
2024-02-27 08:25:18 -06:00
|
|
|
|
--> tests/ui/single_char_pattern.rs:31:15
|
2017-10-09 23:00:47 -05:00
|
|
|
|
|
|
2018-12-27 09:57:55 -06:00
|
|
|
|
LL | x.matches("x");
|
2024-01-25 12:17:36 -06:00
|
|
|
|
| ^^^ help: consider using a `char`: `'x'`
|
2017-10-09 23:00:47 -05:00
|
|
|
|
|
|
|
|
|
error: single-character string constant used as pattern
|
2024-02-27 08:25:18 -06:00
|
|
|
|
--> tests/ui/single_char_pattern.rs:32:16
|
2017-10-09 23:00:47 -05:00
|
|
|
|
|
|
2018-12-27 09:57:55 -06:00
|
|
|
|
LL | x.rmatches("x");
|
2024-01-25 12:17:36 -06:00
|
|
|
|
| ^^^ help: consider using a `char`: `'x'`
|
2017-10-09 23:00:47 -05:00
|
|
|
|
|
|
|
|
|
error: single-character string constant used as pattern
|
2024-02-27 08:25:18 -06:00
|
|
|
|
--> tests/ui/single_char_pattern.rs:33:21
|
2017-10-09 23:00:47 -05:00
|
|
|
|
|
|
2018-12-27 09:57:55 -06:00
|
|
|
|
LL | x.match_indices("x");
|
2024-01-25 12:17:36 -06:00
|
|
|
|
| ^^^ help: consider using a `char`: `'x'`
|
2017-10-09 23:00:47 -05:00
|
|
|
|
|
|
|
|
|
error: single-character string constant used as pattern
|
2024-02-27 08:25:18 -06:00
|
|
|
|
--> tests/ui/single_char_pattern.rs:34:22
|
2017-10-09 23:00:47 -05:00
|
|
|
|
|
|
2018-12-27 09:57:55 -06:00
|
|
|
|
LL | x.rmatch_indices("x");
|
2024-01-25 12:17:36 -06:00
|
|
|
|
| ^^^ help: consider using a `char`: `'x'`
|
2017-10-09 23:00:47 -05:00
|
|
|
|
|
|
|
|
|
error: single-character string constant used as pattern
|
2024-02-27 08:25:18 -06:00
|
|
|
|
--> tests/ui/single_char_pattern.rs:35:26
|
2017-10-09 23:00:47 -05:00
|
|
|
|
|
|
2018-12-27 09:57:55 -06:00
|
|
|
|
LL | x.trim_start_matches("x");
|
2024-01-25 12:17:36 -06:00
|
|
|
|
| ^^^ help: consider using a `char`: `'x'`
|
2017-10-09 23:00:47 -05:00
|
|
|
|
|
|
|
|
|
error: single-character string constant used as pattern
|
2024-02-27 08:25:18 -06:00
|
|
|
|
--> tests/ui/single_char_pattern.rs:36:24
|
2017-10-09 23:00:47 -05:00
|
|
|
|
|
|
2018-12-27 09:57:55 -06:00
|
|
|
|
LL | x.trim_end_matches("x");
|
2024-01-25 12:17:36 -06:00
|
|
|
|
| ^^^ help: consider using a `char`: `'x'`
|
2017-10-09 23:00:47 -05:00
|
|
|
|
|
2018-03-02 09:00:01 -06:00
|
|
|
|
error: single-character string constant used as pattern
|
2024-02-27 08:25:18 -06:00
|
|
|
|
--> tests/ui/single_char_pattern.rs:37:20
|
2021-05-06 04:51:22 -05:00
|
|
|
|
|
|
|
|
|
|
LL | x.strip_prefix("x");
|
2024-01-25 12:17:36 -06:00
|
|
|
|
| ^^^ help: consider using a `char`: `'x'`
|
2021-05-06 04:51:22 -05:00
|
|
|
|
|
|
|
|
|
error: single-character string constant used as pattern
|
2024-02-27 08:25:18 -06:00
|
|
|
|
--> tests/ui/single_char_pattern.rs:38:20
|
2021-05-06 04:51:22 -05:00
|
|
|
|
|
|
|
|
|
|
LL | x.strip_suffix("x");
|
2024-01-25 12:17:36 -06:00
|
|
|
|
| ^^^ help: consider using a `char`: `'x'`
|
2021-05-06 04:51:22 -05:00
|
|
|
|
|
|
|
|
|
error: single-character string constant used as pattern
|
2024-02-27 08:25:18 -06:00
|
|
|
|
--> tests/ui/single_char_pattern.rs:39:15
|
2021-12-06 05:33:31 -06:00
|
|
|
|
|
|
|
|
|
|
LL | x.replace("x", "y");
|
2024-01-25 12:17:36 -06:00
|
|
|
|
| ^^^ help: consider using a `char`: `'x'`
|
2021-12-06 05:33:31 -06:00
|
|
|
|
|
|
|
|
|
error: single-character string constant used as pattern
|
2024-02-27 08:25:18 -06:00
|
|
|
|
--> tests/ui/single_char_pattern.rs:40:16
|
2021-12-06 05:33:31 -06:00
|
|
|
|
|
|
|
|
|
|
LL | x.replacen("x", "y", 3);
|
2024-01-25 12:17:36 -06:00
|
|
|
|
| ^^^ help: consider using a `char`: `'x'`
|
2021-12-06 05:33:31 -06:00
|
|
|
|
|
|
|
|
|
error: single-character string constant used as pattern
|
2024-02-27 08:25:18 -06:00
|
|
|
|
--> tests/ui/single_char_pattern.rs:42:13
|
2018-03-02 09:00:01 -06:00
|
|
|
|
|
|
2023-08-24 14:32:12 -05:00
|
|
|
|
LL | x.split("\n");
|
2024-01-25 12:17:36 -06:00
|
|
|
|
| ^^^^ help: consider using a `char`: `'\n'`
|
2018-03-02 09:00:01 -06:00
|
|
|
|
|
2018-07-31 05:20:32 -05:00
|
|
|
|
error: single-character string constant used as pattern
|
2024-02-27 08:25:18 -06:00
|
|
|
|
--> tests/ui/single_char_pattern.rs:43:13
|
2019-04-08 07:55:50 -05:00
|
|
|
|
|
|
|
|
|
|
LL | x.split("'");
|
2024-01-25 12:17:36 -06:00
|
|
|
|
| ^^^ help: consider using a `char`: `'\''`
|
2019-04-08 07:55:50 -05:00
|
|
|
|
|
|
|
|
|
error: single-character string constant used as pattern
|
2024-02-27 08:25:18 -06:00
|
|
|
|
--> tests/ui/single_char_pattern.rs:44:13
|
2019-04-08 07:55:50 -05:00
|
|
|
|
|
|
2023-08-24 14:32:12 -05:00
|
|
|
|
LL | x.split("\'");
|
2024-01-25 12:17:36 -06:00
|
|
|
|
| ^^^^ help: consider using a `char`: `'\''`
|
2019-04-08 07:55:50 -05:00
|
|
|
|
|
|
|
|
|
error: single-character string constant used as pattern
|
2024-02-27 08:25:18 -06:00
|
|
|
|
--> tests/ui/single_char_pattern.rs:46:13
|
2024-01-11 10:27:03 -06:00
|
|
|
|
|
|
|
|
|
|
LL | x.split("\"");
|
2024-01-25 12:17:36 -06:00
|
|
|
|
| ^^^^ help: consider using a `char`: `'"'`
|
2024-01-11 10:27:03 -06:00
|
|
|
|
|
|
|
|
|
error: single-character string constant used as pattern
|
2024-02-27 08:25:18 -06:00
|
|
|
|
--> tests/ui/single_char_pattern.rs:51:31
|
2018-07-31 05:20:32 -05:00
|
|
|
|
|
|
2021-12-06 05:33:31 -06:00
|
|
|
|
LL | x.replace(';', ",").split(","); // issue #2978
|
2024-01-25 12:17:36 -06:00
|
|
|
|
| ^^^ help: consider using a `char`: `','`
|
2018-07-31 05:20:32 -05:00
|
|
|
|
|
2018-08-03 03:19:29 -05:00
|
|
|
|
error: single-character string constant used as pattern
|
2024-02-27 08:25:18 -06:00
|
|
|
|
--> tests/ui/single_char_pattern.rs:52:19
|
2018-08-03 03:19:29 -05:00
|
|
|
|
|
|
2023-08-24 14:32:12 -05:00
|
|
|
|
LL | x.starts_with("\x03"); // issue #2996
|
2024-01-25 12:17:36 -06:00
|
|
|
|
| ^^^^^^ help: consider using a `char`: `'\x03'`
|
2018-08-03 03:19:29 -05:00
|
|
|
|
|
2019-08-08 22:45:49 -05:00
|
|
|
|
error: single-character string constant used as pattern
|
2024-02-27 08:25:18 -06:00
|
|
|
|
--> tests/ui/single_char_pattern.rs:59:13
|
2019-08-08 22:45:49 -05:00
|
|
|
|
|
|
|
|
|
|
LL | x.split(r"a");
|
2024-01-25 12:17:36 -06:00
|
|
|
|
| ^^^^ help: consider using a `char`: `'a'`
|
2019-08-08 22:45:49 -05:00
|
|
|
|
|
|
|
|
|
error: single-character string constant used as pattern
|
2024-02-27 08:25:18 -06:00
|
|
|
|
--> tests/ui/single_char_pattern.rs:60:13
|
2019-08-08 22:45:49 -05:00
|
|
|
|
|
|
|
|
|
|
LL | x.split(r#"a"#);
|
2024-01-25 12:17:36 -06:00
|
|
|
|
| ^^^^^^ help: consider using a `char`: `'a'`
|
2019-08-08 22:45:49 -05:00
|
|
|
|
|
2019-08-08 22:45:49 -05:00
|
|
|
|
error: single-character string constant used as pattern
|
2024-02-27 08:25:18 -06:00
|
|
|
|
--> tests/ui/single_char_pattern.rs:61:13
|
2019-08-08 22:45:49 -05:00
|
|
|
|
|
|
|
|
|
|
LL | x.split(r###"a"###);
|
2024-01-25 12:17:36 -06:00
|
|
|
|
| ^^^^^^^^^^ help: consider using a `char`: `'a'`
|
2019-08-08 22:45:49 -05:00
|
|
|
|
|
|
|
|
|
error: single-character string constant used as pattern
|
2024-02-27 08:25:18 -06:00
|
|
|
|
--> tests/ui/single_char_pattern.rs:62:13
|
2019-08-08 22:45:49 -05:00
|
|
|
|
|
|
|
|
|
|
LL | x.split(r###"'"###);
|
2024-01-25 12:17:36 -06:00
|
|
|
|
| ^^^^^^^^^^ help: consider using a `char`: `'\''`
|
2019-08-08 22:45:49 -05:00
|
|
|
|
|
|
|
|
|
error: single-character string constant used as pattern
|
2024-02-27 08:25:18 -06:00
|
|
|
|
--> tests/ui/single_char_pattern.rs:63:13
|
2019-08-08 22:45:49 -05:00
|
|
|
|
|
|
|
|
|
|
LL | x.split(r###"#"###);
|
2024-01-25 12:17:36 -06:00
|
|
|
|
| ^^^^^^^^^^ help: consider using a `char`: `'#'`
|
2019-08-08 22:45:49 -05:00
|
|
|
|
|
2021-12-06 05:33:31 -06:00
|
|
|
|
error: single-character string constant used as pattern
|
2024-02-27 08:25:18 -06:00
|
|
|
|
--> tests/ui/single_char_pattern.rs:65:13
|
2021-12-06 05:33:31 -06:00
|
|
|
|
|
|
2023-08-24 14:32:12 -05:00
|
|
|
|
LL | x.split(r#"\"#);
|
2024-01-25 12:17:36 -06:00
|
|
|
|
| ^^^^^^ help: consider using a `char`: `'\\'`
|
2021-12-06 05:33:31 -06:00
|
|
|
|
|
|
|
|
|
error: single-character string constant used as pattern
|
2024-02-27 08:25:18 -06:00
|
|
|
|
--> tests/ui/single_char_pattern.rs:66:13
|
2021-12-06 05:33:31 -06:00
|
|
|
|
|
|
2023-08-24 14:32:12 -05:00
|
|
|
|
LL | x.split(r"\");
|
2024-01-25 12:17:36 -06:00
|
|
|
|
| ^^^^ help: consider using a `char`: `'\\'`
|
2021-12-06 05:33:31 -06:00
|
|
|
|
|
2024-01-11 10:27:03 -06:00
|
|
|
|
error: aborting due to 40 previous errors
|
2018-01-16 10:06:27 -06:00
|
|
|
|
|