Skip to content

Commit

Permalink
Use std::sync::LazyLock instead
Browse files Browse the repository at this point in the history
  • Loading branch information
yozhgoor committed Dec 7, 2024
1 parent 62fcdd1 commit bb974a5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/dependency.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use anyhow::{bail, Result};
use regex::Regex;
use std::cell::LazyCell;
use std::sync::LazyLock;

#[derive(Debug, PartialEq, Eq, Clone)]
pub enum Dependency {
Expand All @@ -19,7 +19,7 @@ pub enum Dependency {
}

pub fn parse_dependency(s: &str) -> Result<Dependency> {
static RE: LazyCell<Regex> = LazyCell::new(|| {
static RE: LazyLock<Regex> = LazyLock::new(|| {
Regex::new(r"^((?P<name>[^+=/]+)=)?(?P<version>((?P<url>\w+://([^:@]+(:[^@]+)?@)?[^#+]*?(?P<url_end>/[^#+/]+)?)(#branch=(?P<branch>[^+]+)|#rev=(?P<rev>[^+]+))?)|[^+]+)?(?P<features>(\+[^+]+)*)$")
.unwrap()
});
Expand Down

0 comments on commit bb974a5

Please sign in to comment.