@@ -1229,12 +1229,13 @@ impl<'a> Parser<'a> {
1229
1229
}
1230
1230
}
1231
1231
}
1232
-
1233
- let segment_before_slash = if ends_with_slash {
1234
- & self . serialization [ segment_start..self . serialization . len ( ) - 1 ]
1232
+ // Going from &str to String to &str to please the 1.33.0 borrow checker
1233
+ let before_slash_string = if ends_with_slash {
1234
+ self . serialization [ segment_start..self . serialization . len ( ) - 1 ] . to_owned ( )
1235
1235
} else {
1236
- & self . serialization [ segment_start..self . serialization . len ( ) ]
1236
+ self . serialization [ segment_start..self . serialization . len ( ) ] . to_owned ( )
1237
1237
} ;
1238
+ let segment_before_slash: & str = & before_slash_string;
1238
1239
match segment_before_slash {
1239
1240
// If buffer is a double-dot path segment, shorten url’s path,
1240
1241
".." | "%2e%2e" | "%2e%2E" | "%2E%2e" | "%2E%2E" | "%2e." | "%2E." | ".%2e"
@@ -1307,16 +1308,18 @@ impl<'a> Parser<'a> {
1307
1308
if self . serialization . len ( ) == path_start {
1308
1309
return ;
1309
1310
}
1310
- // If url’s scheme is "file", path’s size is 1, and path[0] is a normalized Windows drive letter, then return.
1311
- let segments: Vec < & str > = self . serialization [ path_start..]
1312
- . split ( '/' )
1313
- . filter ( |s| !s. is_empty ( ) )
1314
- . collect ( ) ;
1315
- if scheme_type. is_file ( )
1316
- && segments. len ( ) == 1
1317
- && is_normalized_windows_drive_letter ( segments[ 0 ] )
1318
1311
{
1319
- return ;
1312
+ // If url’s scheme is "file", path’s size is 1, and path[0] is a normalized Windows drive letter, then return.
1313
+ let segments: Vec < & str > = self . serialization [ path_start..]
1314
+ . split ( '/' )
1315
+ . filter ( |s| !s. is_empty ( ) )
1316
+ . collect ( ) ;
1317
+ if scheme_type. is_file ( )
1318
+ && segments. len ( ) == 1
1319
+ && is_normalized_windows_drive_letter ( segments[ 0 ] )
1320
+ {
1321
+ return ;
1322
+ }
1320
1323
}
1321
1324
// Remove path’s last item.
1322
1325
self . pop_path ( scheme_type, path_start) ;
0 commit comments