mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-14 17:07:17 +00:00
171 lines
4.8 KiB
Text
171 lines
4.8 KiB
Text
error: trivial regex
|
|
--> $DIR/regex.rs:26:45
|
|
|
|
|
26 | let pipe_in_wrong_position = Regex::new("|");
|
|
| ^^^
|
|
|
|
|
= note: `-D clippy::trivial-regex` implied by `-D warnings`
|
|
= help: the regex is unlikely to be useful as it is
|
|
|
|
error: trivial regex
|
|
--> $DIR/regex.rs:27:60
|
|
|
|
|
27 | let pipe_in_wrong_position_builder = RegexBuilder::new("|");
|
|
| ^^^
|
|
|
|
|
= help: the regex is unlikely to be useful as it is
|
|
|
|
error: regex syntax error: invalid character class range, the start must be <= the end
|
|
--> $DIR/regex.rs:28:42
|
|
|
|
|
28 | let wrong_char_ranice = Regex::new("[z-a]");
|
|
| ^^^
|
|
|
|
|
= note: `-D clippy::invalid-regex` implied by `-D warnings`
|
|
|
|
error: regex syntax error: invalid character class range, the start must be <= the end
|
|
--> $DIR/regex.rs:29:37
|
|
|
|
|
29 | let some_unicode = Regex::new("[é-è]");
|
|
| ^^^
|
|
|
|
error: regex syntax error on position 0: unclosed group
|
|
--> $DIR/regex.rs:31:33
|
|
|
|
|
31 | let some_regex = Regex::new(OPENING_PAREN);
|
|
| ^^^^^^^^^^^^^
|
|
|
|
error: trivial regex
|
|
--> $DIR/regex.rs:33:53
|
|
|
|
|
33 | let binary_pipe_in_wrong_position = BRegex::new("|");
|
|
| ^^^
|
|
|
|
|
= help: the regex is unlikely to be useful as it is
|
|
|
|
error: regex syntax error on position 0: unclosed group
|
|
--> $DIR/regex.rs:34:41
|
|
|
|
|
34 | let some_binary_regex = BRegex::new(OPENING_PAREN);
|
|
| ^^^^^^^^^^^^^
|
|
|
|
error: regex syntax error on position 0: unclosed group
|
|
--> $DIR/regex.rs:35:56
|
|
|
|
|
35 | let some_binary_regex_builder = BRegexBuilder::new(OPENING_PAREN);
|
|
| ^^^^^^^^^^^^^
|
|
|
|
error: regex syntax error on position 0: unclosed group
|
|
--> $DIR/regex.rs:51:9
|
|
|
|
|
51 | OPENING_PAREN,
|
|
| ^^^^^^^^^^^^^
|
|
|
|
error: regex syntax error on position 0: unclosed group
|
|
--> $DIR/regex.rs:55:9
|
|
|
|
|
55 | OPENING_PAREN,
|
|
| ^^^^^^^^^^^^^
|
|
|
|
error: regex syntax error: unrecognized escape sequence
|
|
--> $DIR/regex.rs:59:45
|
|
|
|
|
59 | let raw_string_error = Regex::new(r"[...//...]");
|
|
| ^^
|
|
|
|
error: regex syntax error: unrecognized escape sequence
|
|
--> $DIR/regex.rs:60:46
|
|
|
|
|
60 | let raw_string_error = Regex::new(r#"[...//...]"#);
|
|
| ^^
|
|
|
|
error: trivial regex
|
|
--> $DIR/regex.rs:64:33
|
|
|
|
|
64 | let trivial_eq = Regex::new("^foobar$");
|
|
| ^^^^^^^^^^
|
|
|
|
|
= help: consider using `==` on `str`s
|
|
|
|
error: trivial regex
|
|
--> $DIR/regex.rs:66:48
|
|
|
|
|
66 | let trivial_eq_builder = RegexBuilder::new("^foobar$");
|
|
| ^^^^^^^^^^
|
|
|
|
|
= help: consider using `==` on `str`s
|
|
|
|
error: trivial regex
|
|
--> $DIR/regex.rs:68:42
|
|
|
|
|
68 | let trivial_starts_with = Regex::new("^foobar");
|
|
| ^^^^^^^^^
|
|
|
|
|
= help: consider using `str::starts_with`
|
|
|
|
error: trivial regex
|
|
--> $DIR/regex.rs:70:40
|
|
|
|
|
70 | let trivial_ends_with = Regex::new("foobar$");
|
|
| ^^^^^^^^^
|
|
|
|
|
= help: consider using `str::ends_with`
|
|
|
|
error: trivial regex
|
|
--> $DIR/regex.rs:72:39
|
|
|
|
|
72 | let trivial_contains = Regex::new("foobar");
|
|
| ^^^^^^^^
|
|
|
|
|
= help: consider using `str::contains`
|
|
|
|
error: trivial regex
|
|
--> $DIR/regex.rs:74:39
|
|
|
|
|
74 | let trivial_contains = Regex::new(NOT_A_REAL_REGEX);
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `str::contains`
|
|
|
|
error: trivial regex
|
|
--> $DIR/regex.rs:76:40
|
|
|
|
|
76 | let trivial_backslash = Regex::new("a/.b");
|
|
| ^^^^^^^
|
|
|
|
|
= help: consider using `str::contains`
|
|
|
|
error: trivial regex
|
|
--> $DIR/regex.rs:79:36
|
|
|
|
|
79 | let trivial_empty = Regex::new("");
|
|
| ^^
|
|
|
|
|
= help: the regex is unlikely to be useful as it is
|
|
|
|
error: trivial regex
|
|
--> $DIR/regex.rs:81:36
|
|
|
|
|
81 | let trivial_empty = Regex::new("^");
|
|
| ^^^
|
|
|
|
|
= help: the regex is unlikely to be useful as it is
|
|
|
|
error: trivial regex
|
|
--> $DIR/regex.rs:83:36
|
|
|
|
|
83 | let trivial_empty = Regex::new("^$");
|
|
| ^^^^
|
|
|
|
|
= help: consider using `str::is_empty`
|
|
|
|
error: trivial regex
|
|
--> $DIR/regex.rs:85:44
|
|
|
|
|
85 | let binary_trivial_empty = BRegex::new("^$");
|
|
| ^^^^
|
|
|
|
|
= help: consider using `str::is_empty`
|
|
|
|
error: aborting due to 23 previous errors
|
|
|