Add parsed URL to PubGrubPackage (#3426)

Avoid reparsing urls by storing the parsed parts across resolution on
`PubGrubPackage`.

Part 1 of #3408
This commit is contained in:
konsti 2024-05-14 02:55:21 +02:00 committed by GitHub
parent 5132c6a6e2
commit 0010954ca7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
17 changed files with 194 additions and 79 deletions

View file

@ -54,7 +54,7 @@ enum RefspecStrategy {
impl GitReference {
/// Creates a [`GitReference`] from an arbitrary revision string, which could represent a
/// branch, tag, commit, or named ref.
pub(crate) fn from_rev(rev: &str) -> Self {
pub fn from_rev(rev: &str) -> Self {
if rev.starts_with("refs/") {
Self::NamedRef(rev.to_owned())
} else if looks_like_commit_hash(rev) {