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