Fix Registry::url

Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com>
This commit is contained in:
Jiahao XU 2025-06-04 00:34:57 +10:00 committed by GitHub
parent a356179804
commit ce87169b26
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -202,10 +202,15 @@ impl Registry {
/// Get url of the regsitry /// Get url of the regsitry
pub fn url(&self) -> impl fmt::Display + '_ { pub fn url(&self) -> impl fmt::Display + '_ {
match self { #[cfg(feature = "git")]
#[cfg(feature = "git")] return match self {
Registry::Git(registry) => either::Left(registry.url()), Registry::Git(registry) => either::Left(registry.url()),
Registry::Sparse(registry) => either::Right(registry.url()), Registry::Sparse(registry) => either::Right(registry.url()),
};
#[cfg(not(feature = "git"))]
match self {
Registry::Sparse(registry) => registry.url(),
} }
} }