review comment

This commit is contained in:
Geoffrey Thomas 2025-07-18 23:00:50 +00:00
parent 66937e35fa
commit ecebc914a6
1 changed files with 3 additions and 7 deletions

View File

@ -677,13 +677,9 @@ impl ManagedPythonDownloadList {
if let Ok(url) = Url::parse(url_or_path) { if let Ok(url) = Url::parse(url_or_path) {
match url.scheme() { match url.scheme() {
"http" | "https" => Source::Http(url), "http" | "https" => Source::Http(url),
"file" => { "file" => Source::Path(Cow::Owned(
if let Ok(path) = url.to_file_path() { url.to_file_path().or(Err(Error::InvalidUrlFormat(url)))?,
Source::Path(Cow::Owned(path)) )),
} else {
return Err(Error::InvalidUrlFormat(url));
}
}
_ => Source::Path(Cow::Borrowed(Path::new(url_or_path))), _ => Source::Path(Cow::Borrowed(Path::new(url_or_path))),
} }
} else { } else {