You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -74,7 +74,7 @@ name
74
74
[ineffective_bit_mask](https://github.com/Manishearth/rust-clippy/wiki#ineffective_bit_mask) | warn | expressions where a bit mask will be rendered useless by a comparison, e.g. `(x | 1) > 2`
75
75
[inline_always](https://github.com/Manishearth/rust-clippy/wiki#inline_always) | warn | `#[inline(always)]` is a bad idea in most cases
76
76
[integer_arithmetic](https://github.com/Manishearth/rust-clippy/wiki#integer_arithmetic) | allow | Any integer arithmetic statement
[invalid_upcast_comparisons](https://github.com/Manishearth/rust-clippy/wiki#invalid_upcast_comparisons) | allow | a comparison involving an upcast which is always true or false
79
79
[items_after_statements](https://github.com/Manishearth/rust-clippy/wiki#items_after_statements) | allow | finds blocks where an item comes after a statement
80
80
[iter_next_loop](https://github.com/Manishearth/rust-clippy/wiki#iter_next_loop) | warn | for-looping over `_.next()` which is probably not intended
@@ -150,7 +150,7 @@ name
150
150
[too_many_arguments](https://github.com/Manishearth/rust-clippy/wiki#too_many_arguments) | warn | functions with too many arguments
151
151
[toplevel_ref_arg](https://github.com/Manishearth/rust-clippy/wiki#toplevel_ref_arg) | warn | An entire binding was declared as `ref`, in a function argument (`fn foo(ref x: Bar)`), or a `let` statement (`let ref x = foo()`). In such cases, it is preferred to take references with `&`.
152
152
[transmute_ptr_to_ref](https://github.com/Manishearth/rust-clippy/wiki#transmute_ptr_to_ref) | warn | transmutes from a pointer to a reference type
[type_complexity](https://github.com/Manishearth/rust-clippy/wiki#type_complexity) | warn | usage of very complex types; recommends factoring out parts into `type` definitions
155
155
[unicode_not_nfc](https://github.com/Manishearth/rust-clippy/wiki#unicode_not_nfc) | allow | using a unicode literal not in NFC normal form (see [unicode tr15](http://www.unicode.org/reports/tr15/) for further information)
156
156
[unit_cmp](https://github.com/Manishearth/rust-clippy/wiki#unit_cmp) | warn | comparing unit values (which is always `true` or `false`, respectively)
"finds invalid regular expressions in `Regex::new(_)` invocations"
25
+
"finds invalid regular expressions"
25
26
}
26
27
27
-
/// **What it does:** This lint checks for `Regex::new(_)` invocations with trivial regex.
28
+
/// **What it does:** This lint checks for trivial [regex] creation (with `Regex::new`,
29
+
/// `RegexBuilder::new` or `RegexSet::new`).
28
30
///
29
31
/// **Why is this bad?** This can likely be replaced by `==` or `str::starts_with`,
30
32
/// `str::ends_with` or `std::contains` or other `str` methods.
31
33
///
32
34
/// **Known problems:** None.
33
35
///
34
36
/// **Example:** `Regex::new("^foobar")`
37
+
///
38
+
/// [regex]: https://crates.io/crates/regex
35
39
declare_lint!{
36
40
pubTRIVIAL_REGEX,
37
41
Warn,
38
-
"finds trivial regular expressions in `Regex::new(_)` invocations"
42
+
"finds trivial regular expressions"
39
43
}
40
44
41
45
/// **What it does:** This lint checks for usage of `regex!(_)` which as of now is usually slower than `Regex::new(_)` unless called in a loop (which is a bad idea anyway).
0 commit comments