Optimize GhCrateMeta::check: Avoid converting url to str

Only to convert it back to `Url` in `helpers::remote_exists`

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
Jiahao XU 2022-06-07 15:40:55 +10:00
parent 0c83d010b1
commit b2a533dbdb
No known key found for this signature in database
GPG key ID: 591C0B03040416D6
3 changed files with 3 additions and 4 deletions

View file

@ -32,8 +32,7 @@ pub fn load_manifest_path<P: AsRef<Path>>(
Ok(manifest)
}
pub async fn remote_exists(url: &str, method: Method) -> Result<bool, BinstallError> {
let url = Url::parse(url)?;
pub async fn remote_exists(url: Url, method: Method) -> Result<bool, BinstallError> {
let req = reqwest::Client::new()
.request(method.clone(), url.clone())
.send()