Skip to content

Commit

Permalink
Fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
valenting committed May 30, 2023
1 parent df88a29 commit 21f32d6
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions url/src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,7 @@ pub fn default_port(scheme: &str) -> Option<u16> {
}
}

#[derive(Clone)]
#[derive(Debug)]
#[derive(Clone, Debug)]
pub struct Input<'i> {
chars: str::Chars<'i>,
}
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 21f32d6

Please sign in to comment.