Skip to content

Commit aef4772

Browse files
authored
Examples fixes for regex (#13874)
Examples fixes for regex changelog: none
2 parents 786f090 + be09596 commit aef4772

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

clippy_lints/src/regex.rs

+10
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ declare_clippy_lint! {
2424
/// ```ignore
2525
/// Regex::new("(")
2626
/// ```
27+
///
28+
/// Use instead:
29+
/// ```ignore
30+
/// Regex::new("\(")
31+
/// ```
2732
#[clippy::version = "pre 1.29.0"]
2833
pub INVALID_REGEX,
2934
correctness,
@@ -49,6 +54,11 @@ declare_clippy_lint! {
4954
/// ```ignore
5055
/// Regex::new("^foobar")
5156
/// ```
57+
///
58+
/// Use instead:
59+
/// ```ignore
60+
/// str::starts_with("foobar")
61+
/// ```
5262
#[clippy::version = "pre 1.29.0"]
5363
pub TRIVIAL_REGEX,
5464
nursery,

0 commit comments

Comments
 (0)