diff options
Diffstat (limited to 'crates/shirabe/src/util/composer_mirror.rs')
| -rw-r--r-- | crates/shirabe/src/util/composer_mirror.rs | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/crates/shirabe/src/util/composer_mirror.rs b/crates/shirabe/src/util/composer_mirror.rs index 7344bfaf..5d9e8c31 100644 --- a/crates/shirabe/src/util/composer_mirror.rs +++ b/crates/shirabe/src/util/composer_mirror.rs @@ -61,14 +61,8 @@ impl ComposerMirror { ) { format!( "gh-{}/{}", - gh_matches - .get(&CaptureKey::ByIndex(1)) - .cloned() - .unwrap_or_default(), - gh_matches - .get(&CaptureKey::ByIndex(2)) - .cloned() - .unwrap_or_default(), + gh_matches.get(&CaptureKey::ByIndex(1)).unwrap_or_default(), + gh_matches.get(&CaptureKey::ByIndex(2)).unwrap_or_default(), ) } else if let Some(bb_matches) = Preg::match3( php_regex!(r"#^https://bitbucket\.org/([^/]+)/(.+?)(?:\.git)?/?$#"), @@ -76,14 +70,8 @@ impl ComposerMirror { ) { format!( "bb-{}/{}", - bb_matches - .get(&CaptureKey::ByIndex(1)) - .cloned() - .unwrap_or_default(), - bb_matches - .get(&CaptureKey::ByIndex(2)) - .cloned() - .unwrap_or_default(), + bb_matches.get(&CaptureKey::ByIndex(1)).unwrap_or_default(), + bb_matches.get(&CaptureKey::ByIndex(2)).unwrap_or_default(), ) } else { Preg::replace(php_regex!(r"{[^a-z0-9_.-]}i"), "-", url.trim_matches('/')) |
