Skip to content

Commit 3c7afd7

Browse files
authored
Update regex example (#367)
* prefer LazyLock from rust std library * fix error in regex example
1 parent 7a4b035 commit 3c7afd7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -251,13 +251,13 @@ Tests whether the string matches the regex given. `regex` takes
251251
Examples:
252252

253253
```rust
254-
use once_cell::sync::Lazy;
254+
use std::sync::LazyLock;
255255

256256
static RE_TWO_CHARS: Lazy<Regex> = Lazy::new(|| {
257257
Regex::new(r"[a-z]{2}$").unwrap()
258258
});
259259

260-
#[validate(regex(path = *RE_TWO_CHARS)]
260+
#[validate(regex(path = *RE_TWO_CHARS))]
261261
```
262262

263263
### credit\_card

0 commit comments

Comments
 (0)