From 640e308c16309a12faffce45e01959b9315901ca Mon Sep 17 00:00:00 2001 From: Anhad Singh Date: Fri, 9 Jan 2026 14:09:04 +1100 Subject: [PATCH] misc(url/redox): switch to the new scheme format Signed-off-by: Anhad Singh --- url/src/lib.rs | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/url/src/lib.rs b/url/src/lib.rs index f1558682b..173589d0f 100644 --- a/url/src/lib.rs +++ b/url/src/lib.rs @@ -2734,18 +2734,7 @@ impl Url { }; let str_len = self.as_str().len(); - let estimated_capacity = if cfg!(target_os = "redox") { - let scheme_len = self.scheme().len(); - let file_scheme_len = "file".len(); - // remove only // because it still has file: - if scheme_len < file_scheme_len { - let scheme_diff = file_scheme_len - scheme_len; - (str_len + scheme_diff).saturating_sub(2) - } else { - let scheme_diff = scheme_len - file_scheme_len; - str_len.saturating_sub(scheme_diff + 2) - } - } else if cfg!(windows) { + let estimated_capacity = if cfg!(windows) { // remove scheme: - has possible \\ for hostname str_len.saturating_sub(self.scheme().len() + 1) } else { @@ -3081,9 +3070,6 @@ fn file_url_segments_to_pathbuf( let mut bytes = Vec::new(); bytes.try_reserve(estimated_capacity).map_err(|_| ())?; - if cfg!(target_os = "redox") { - bytes.extend(b"file:"); - } for segment in segments { bytes.push(b'/');