diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 03:57:31 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 03:57:31 +0000 |
commit | dc0db358abe19481e475e10c32149b53370f1a1c (patch) | |
tree | ab8ce99c4b255ce46f99ef402c27916055b899ee /vendor/gix-url/src | |
parent | Releasing progress-linux version 1.71.1+dfsg1-2~progress7.99u1. (diff) | |
download | rustc-dc0db358abe19481e475e10c32149b53370f1a1c.tar.xz rustc-dc0db358abe19481e475e10c32149b53370f1a1c.zip |
Merging upstream version 1.72.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/gix-url/src')
-rw-r--r-- | vendor/gix-url/src/parse.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/vendor/gix-url/src/parse.rs b/vendor/gix-url/src/parse.rs index bb9c1f38b..e6e7d4872 100644 --- a/vendor/gix-url/src/parse.rs +++ b/vendor/gix-url/src/parse.rs @@ -92,8 +92,9 @@ pub fn parse(input: &BStr) -> Result<crate::Url, Error> { let guessed_protocol = guess_protocol(input).ok_or_else(|| Error::NotALocalFile { url: input.into() })?; let path_without_file_protocol = input.strip_prefix(b"file://"); if path_without_file_protocol.is_some() || (has_no_explicit_protocol(input) && guessed_protocol == "file") { - let path: BString = path_without_file_protocol - .map(|stripped_path| { + let path: BString = path_without_file_protocol.map_or_else( + || input.into(), + |stripped_path| { #[cfg(windows)] { if stripped_path.starts_with(b"/") { @@ -113,8 +114,8 @@ pub fn parse(input: &BStr) -> Result<crate::Url, Error> { { stripped_path.into() } - }) - .unwrap_or_else(|| input.into()); + }, + ); if path.is_empty() { return Err(Error::MissingRepositoryPath); } |