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) {
match url.scheme() {
"http" | "https" => Source::Http(url),
"file" => {
if let Ok(path) = url.to_file_path() {
Source::Path(Cow::Owned(path))
} else {
return Err(Error::InvalidUrlFormat(url));
}
}
"file" => Source::Path(Cow::Owned(
url.to_file_path().or(Err(Error::InvalidUrlFormat(url)))?,
)),
_ => Source::Path(Cow::Borrowed(Path::new(url_or_path))),
}
} else {