From 6b64129185ed7e4bc3544285cf3716999d0db9c6 Mon Sep 17 00:00:00 2001 From: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Date: Fri, 6 Jun 2025 13:37:00 +1000 Subject: [PATCH] Fix typing in `Registry::crate_source` Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> --- crates/binstalk-registry/src/lib.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/crates/binstalk-registry/src/lib.rs b/crates/binstalk-registry/src/lib.rs index 8746f69e..fe181696 100644 --- a/crates/binstalk-registry/src/lib.rs +++ b/crates/binstalk-registry/src/lib.rs @@ -204,7 +204,7 @@ impl Registry { pub fn url(&self) -> Result, UrlParseError> { match self { #[cfg(feature = "git")] - Registry::Git(registry) => Url::parse(®istry.url().to_string()).map_ok(MaybeOwned::Owned), + Registry::Git(registry) => Url::parse(®istry.url().to_string()).map(MaybeOwned::Owned), Registry::Sparse(registry) => Ok(MaybeOwned::Borrowed(registry.url())), } } @@ -218,14 +218,14 @@ impl Registry { Registry::Sparse(_) => SourceType::Sparse, }; - match (registry.as_str(), source_type) { + Ok(match (registry.as_str(), source_type) { ("https://index.crates.io/", SourceType::Sparse) | ("https://github.com/rust-lang/crates.io-index", SourceType::Git) => CrateSource::cratesio_registry(), _ => CrateSource { source_type, url: MaybeOwned::Owned(registry.into_owned()), }, - } + }) } } @@ -233,8 +233,8 @@ impl fmt::Display for Registry { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match self { #[cfg(feature = "git")] - Registry::Git(registry) => fmt::Display::fmt(®istry.url(), fmt), - Registry::Sparse(registry) => fmt::Display::fmt(®istry.url(), fmt), + Registry::Git(registry) => fmt::Display::fmt(®istry.url(), f), + Registry::Sparse(registry) => fmt::Display::fmt(®istry.url(), f), } } }