diff --git a/src/fetchers/gh_crate_meta.rs b/src/fetchers/gh_crate_meta.rs index 12bb22ab..0fe37c7d 100644 --- a/src/fetchers/gh_crate_meta.rs +++ b/src/fetchers/gh_crate_meta.rs @@ -37,7 +37,7 @@ impl super::Fetcher for GhCrateMeta { } info!("Checking for package at: '{url}'"); - remote_exists(url.as_str(), Method::HEAD).await + remote_exists(url, Method::HEAD).await } async fn fetch(&self, dst: &Path) -> Result<(), BinstallError> { diff --git a/src/fetchers/quickinstall.rs b/src/fetchers/quickinstall.rs index 96487851..844ae85e 100644 --- a/src/fetchers/quickinstall.rs +++ b/src/fetchers/quickinstall.rs @@ -31,7 +31,7 @@ impl super::Fetcher for QuickInstall { let url = self.package_url(); self.report().await?; info!("Checking for package at: '{url}'"); - remote_exists(&url, Method::HEAD).await + remote_exists(Url::parse(&url)?, Method::HEAD).await } async fn fetch(&self, dst: &Path) -> Result<(), BinstallError> { diff --git a/src/helpers.rs b/src/helpers.rs index e0d85b99..9471eb4f 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -32,8 +32,7 @@ pub fn load_manifest_path>( Ok(manifest) } -pub async fn remote_exists(url: &str, method: Method) -> Result { - let url = Url::parse(url)?; +pub async fn remote_exists(url: Url, method: Method) -> Result { let req = reqwest::Client::new() .request(method.clone(), url.clone()) .send()