diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 18:31:36 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 18:31:36 +0000 |
commit | e02c5b5930c2c9ba3e5423fe12e2ef0155017297 (patch) | |
tree | fd60ebbbb5299e16e5fca8c773ddb74f764760db /vendor/url/src/parser.rs | |
parent | Adding debian version 1.73.0+dfsg1-1. (diff) | |
download | rustc-e02c5b5930c2c9ba3e5423fe12e2ef0155017297.tar.xz rustc-e02c5b5930c2c9ba3e5423fe12e2ef0155017297.zip |
Merging upstream version 1.74.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/url/src/parser.rs')
-rw-r--r-- | vendor/url/src/parser.rs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/vendor/url/src/parser.rs b/vendor/url/src/parser.rs index 765cc027c..7d94d1d71 100644 --- a/vendor/url/src/parser.rs +++ b/vendor/url/src/parser.rs @@ -184,17 +184,13 @@ pub struct Input<'i> { } impl<'i> Input<'i> { - pub fn new(input: &'i str) -> Self { - Input::with_log(input, None) - } - - pub fn no_trim(input: &'i str) -> Self { + pub fn new_no_trim(input: &'i str) -> Self { Input { chars: input.chars(), } } - pub fn trim_tab_and_newlines( + pub fn new_trim_tab_and_newlines( original_input: &'i str, vfn: Option<&dyn Fn(SyntaxViolation)>, ) -> Self { @@ -212,7 +208,10 @@ impl<'i> Input<'i> { } } - pub fn with_log(original_input: &'i str, vfn: Option<&dyn Fn(SyntaxViolation)>) -> Self { + pub fn new_trim_c0_control_and_space( + original_input: &'i str, + vfn: Option<&dyn Fn(SyntaxViolation)>, + ) -> Self { let input = original_input.trim_matches(c0_control_or_space); if let Some(vfn) = vfn { if input.len() < original_input.len() { @@ -362,7 +361,7 @@ impl<'a> Parser<'a> { /// https://url.spec.whatwg.org/#concept-basic-url-parser pub fn parse_url(mut self, input: &str) -> ParseResult<Url> { - let input = Input::with_log(input, self.violation_fn); + let input = Input::new_trim_c0_control_and_space(input, self.violation_fn); if let Ok(remaining) = self.parse_scheme(input.clone()) { return self.parse_with_scheme(remaining); } @@ -1203,6 +1202,7 @@ impl<'a> Parser<'a> { _ => { self.check_url_code_point(c, &input); if scheme_type.is_file() + && self.serialization.len() > path_start && is_normalized_windows_drive_letter( &self.serialization[path_start + 1..], ) |