Skip to content

Commit 21f32d6

Browse files
committed
Fix lint
1 parent df88a29 commit 21f32d6

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

url/src/parser.rs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,7 @@ pub fn default_port(scheme: &str) -> Option<u16> {
178178
}
179179
}
180180

181-
#[derive(Clone)]
182-
#[derive(Debug)]
181+
#[derive(Clone, Debug)]
183182
pub struct Input<'i> {
184183
chars: str::Chars<'i>,
185184
}
@@ -1203,7 +1202,11 @@ impl<'a> Parser<'a> {
12031202
}
12041203
_ => {
12051204
self.check_url_code_point(c, &input);
1206-
if scheme_type.is_file() && is_normalized_windows_drive_letter(&self.serialization[path_start+1..]) {
1205+
if scheme_type.is_file()
1206+
&& is_normalized_windows_drive_letter(
1207+
&self.serialization[path_start + 1..],
1208+
)
1209+
{
12071210
self.serialization.push('/');
12081211
segment_start += 1;
12091212
}
@@ -1254,7 +1257,10 @@ impl<'a> Parser<'a> {
12541257
}
12551258
_ => {
12561259
// If url’s scheme is "file", url’s path is empty, and buffer is a Windows drive letter, then
1257-
if scheme_type.is_file() && segment_start == path_start + 1 && is_windows_drive_letter(segment_before_slash) {
1260+
if scheme_type.is_file()
1261+
&& segment_start == path_start + 1
1262+
&& is_windows_drive_letter(segment_before_slash)
1263+
{
12581264
// Replace the second code point in buffer with U+003A (:).
12591265
if let Some(c) = segment_before_slash.chars().next() {
12601266
self.serialization.truncate(segment_start);

0 commit comments

Comments
 (0)