Examples fixes for regex

This commit is contained in:
alexey semenyuk 2024-12-24 18:36:10 +05:00 committed by GitHub
parent 988042e0b2
commit be09596df9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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,
@ -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,