Skip to content

Commit

Permalink
Examples fixes for regex (rust-lang#13874)
Browse files Browse the repository at this point in the history
Examples fixes for regex

changelog: none
  • Loading branch information
dswij authored Dec 29, 2024
2 parents 786f090 + be09596 commit aef4772
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions clippy_lints/src/regex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ declare_clippy_lint! {
/// ```ignore
/// Regex::new("(")
/// ```
///
/// Use instead:
/// ```ignore
/// Regex::new("\(")
/// ```
#[clippy::version = "pre 1.29.0"]
pub INVALID_REGEX,
correctness,
Expand All @@ -49,6 +54,11 @@ declare_clippy_lint! {
/// ```ignore
/// Regex::new("^foobar")
/// ```
///
/// Use instead:
/// ```ignore
/// str::starts_with("foobar")
/// ```
#[clippy::version = "pre 1.29.0"]
pub TRIVIAL_REGEX,
nursery,
Expand Down

0 comments on commit aef4772

Please sign in to comment.