@@ -1236,12 +1236,13 @@ impl<'a> Parser<'a> {
1236
1236
}
1237
1237
}
1238
1238
}
1239
-
1240
- let segment_before_slash = if ends_with_slash {
1241
- & self . serialization [ segment_start..self . serialization . len ( ) - 1 ]
1239
+ // Going from &str to String to &str to please the 1.33.0 borrow checker
1240
+ let before_slash_string = if ends_with_slash {
1241
+ self . serialization [ segment_start..self . serialization . len ( ) - 1 ] . to_owned ( )
1242
1242
} else {
1243
- & self . serialization [ segment_start..self . serialization . len ( ) ]
1243
+ self . serialization [ segment_start..self . serialization . len ( ) ] . to_owned ( )
1244
1244
} ;
1245
+ let segment_before_slash: & str = & before_slash_string;
1245
1246
match segment_before_slash {
1246
1247
// If buffer is a double-dot path segment, shorten url’s path,
1247
1248
".." | "%2e%2e" | "%2e%2E" | "%2E%2e" | "%2E%2E" | "%2e." | "%2E." | ".%2e"
@@ -1316,16 +1317,18 @@ impl<'a> Parser<'a> {
1316
1317
if self . serialization . len ( ) <= path_start {
1317
1318
return ;
1318
1319
}
1319
- // If url’s scheme is "file", path’s size is 1, and path[0] is a normalized Windows drive letter, then return.
1320
- let segments: Vec < & str > = self . serialization [ path_start..]
1321
- . split ( '/' )
1322
- . filter ( |s| !s. is_empty ( ) )
1323
- . collect ( ) ;
1324
- if scheme_type. is_file ( )
1325
- && segments. len ( ) == 1
1326
- && is_normalized_windows_drive_letter ( segments[ 0 ] )
1327
1320
{
1328
- return ;
1321
+ // If url’s scheme is "file", path’s size is 1, and path[0] is a normalized Windows drive letter, then return.
1322
+ let segments: Vec < & str > = self . serialization [ path_start..]
1323
+ . split ( '/' )
1324
+ . filter ( |s| !s. is_empty ( ) )
1325
+ . collect ( ) ;
1326
+ if scheme_type. is_file ( )
1327
+ && segments. len ( ) == 1
1328
+ && is_normalized_windows_drive_letter ( segments[ 0 ] )
1329
+ {
1330
+ return ;
1331
+ }
1329
1332
}
1330
1333
// Remove path’s last item.
1331
1334
self . pop_path ( scheme_type, path_start) ;
0 commit comments