From 21f32d64b735323880c2913c44e8f370a49518bb Mon Sep 17 00:00:00 2001 From: Valentin Gosu Date: Wed, 31 May 2023 01:07:53 +0300 Subject: [PATCH] Fix lint --- url/src/parser.rs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/url/src/parser.rs b/url/src/parser.rs index ea4c88cd7..765cc027c 100644 --- a/url/src/parser.rs +++ b/url/src/parser.rs @@ -178,8 +178,7 @@ pub fn default_port(scheme: &str) -> Option { } } -#[derive(Clone)] -#[derive(Debug)] +#[derive(Clone, Debug)] pub struct Input<'i> { chars: str::Chars<'i>, } @@ -1203,7 +1202,11 @@ impl<'a> Parser<'a> { } _ => { self.check_url_code_point(c, &input); - if scheme_type.is_file() && is_normalized_windows_drive_letter(&self.serialization[path_start+1..]) { + if scheme_type.is_file() + && is_normalized_windows_drive_letter( + &self.serialization[path_start + 1..], + ) + { self.serialization.push('/'); segment_start += 1; } @@ -1254,7 +1257,10 @@ impl<'a> Parser<'a> { } _ => { // If url’s scheme is "file", url’s path is empty, and buffer is a Windows drive letter, then - if scheme_type.is_file() && segment_start == path_start + 1 && is_windows_drive_letter(segment_before_slash) { + if scheme_type.is_file() + && segment_start == path_start + 1 + && is_windows_drive_letter(segment_before_slash) + { // Replace the second code point in buffer with U+003A (:). if let Some(c) = segment_before_slash.chars().next() { self.serialization.truncate(segment_start);