diff options
Diffstat (limited to 'crates/shirabe/src/util/forgejo_url.rs')
| -rw-r--r-- | crates/shirabe/src/util/forgejo_url.rs | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/crates/shirabe/src/util/forgejo_url.rs b/crates/shirabe/src/util/forgejo_url.rs index 7f9333e0..9ae1cbee 100644 --- a/crates/shirabe/src/util/forgejo_url.rs +++ b/crates/shirabe/src/util/forgejo_url.rs @@ -38,14 +38,9 @@ impl ForgejoUrl { pub fn try_from(repo_url: Option<&str>) -> Option<Self> { let repo_url = repo_url?; let matches = Preg::match3(Self::URL_REGEX, repo_url)?; - use shirabe_pcre::CaptureKey; + let m: Vec<String> = (0..5) - .map(|i| { - matches - .get(&CaptureKey::ByIndex(i)) - .unwrap_or_default() - .to_string() - }) + .map(|i| matches.get(i).unwrap_or_default().to_string()) .collect(); let origin_url = if !m[1].is_empty() { |
