From 716f44031a39c5e43fb441ecc470db76efc23dd4 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sun, 14 Jun 2026 11:24:36 +0900 Subject: refactor(pcre): drop Result from Preg method return types The Preg methods panic on PCRE failure (per the file header rationale), so their anyhow::Result wrappers never carried an Err. Co-Authored-By: Claude Opus 4.8 --- crates/shirabe/src/repository/repository_factory.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'crates/shirabe/src/repository/repository_factory.rs') diff --git a/crates/shirabe/src/repository/repository_factory.rs b/crates/shirabe/src/repository/repository_factory.rs index 5543a9e..71b1471 100644 --- a/crates/shirabe/src/repository/repository_factory.rs +++ b/crates/shirabe/src/repository/repository_factory.rs @@ -332,7 +332,7 @@ impl RepositoryFactory { let mut name = match index { PhpMixed::Int(_) => { if let Some(url) = repo.get("url").and_then(|v| v.as_string()) { - Preg::replace("{^https?://}i", "", url).unwrap_or_else(|_| url.to_string()) + Preg::replace("{^https?://}i", "", url) } else { index.as_string().unwrap_or("").to_string() } @@ -351,7 +351,7 @@ impl RepositoryFactory { existing_repos: &IndexMap, ) -> String { let mut name = if let Some(url) = repo.get("url").and_then(|v| v.as_string()) { - Preg::replace("{^https?://}i", "", url).unwrap_or_else(|_| url.to_string()) + Preg::replace("{^https?://}i", "", url) } else { index.to_string() }; -- cgit v1.3.1