mirror of https://github.com/astral-sh/uv
review comment
This commit is contained in:
parent
66937e35fa
commit
ecebc914a6
|
|
@ -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 {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue