Skip to content

Commit

Permalink
Change unwrap to expect
Browse files Browse the repository at this point in the history
  • Loading branch information
yozhgoor committed Dec 7, 2024
1 parent bb974a5 commit 3d42ca3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/dependency.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ pub enum Dependency {
pub fn parse_dependency(s: &str) -> Result<Dependency> {
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()
.expect("dependency's regex must be compiled")
});

match RE.captures(s) {
Expand Down

0 comments on commit 3d42ca3

Please sign in to comment.