@@ -1218,12 +1218,13 @@ impl<'a> Parser<'a> {
1218
1218
}
1219
1219
}
1220
1220
}
1221
-
1222
- let segment_before_slash = if ends_with_slash {
1223
- & self . serialization [ segment_start..self . serialization . len ( ) - 1 ]
1221
+ // Going from &str to String to &str to please the 1.33.0 borrow checker
1222
+ let before_slash_string = if ends_with_slash {
1223
+ self . serialization [ segment_start..self . serialization . len ( ) - 1 ] . to_owned ( )
1224
1224
} else {
1225
- & self . serialization [ segment_start..self . serialization . len ( ) ]
1225
+ self . serialization [ segment_start..self . serialization . len ( ) ] . to_owned ( )
1226
1226
} ;
1227
+ let segment_before_slash: & str = & before_slash_string;
1227
1228
match segment_before_slash {
1228
1229
// If buffer is a double-dot path segment, shorten url’s path,
1229
1230
".." | "%2e%2e" | "%2e%2E" | "%2E%2e" | "%2E%2E" | "%2e." | "%2E." | ".%2e"
@@ -1298,16 +1299,18 @@ impl<'a> Parser<'a> {
1298
1299
if self . serialization . len ( ) <= path_start {
1299
1300
return ;
1300
1301
}
1301
- // If url’s scheme is "file", path’s size is 1, and path[0] is a normalized Windows drive letter, then return.
1302
- let segments: Vec < & str > = self . serialization [ path_start..]
1303
- . split ( '/' )
1304
- . filter ( |s| !s. is_empty ( ) )
1305
- . collect ( ) ;
1306
- if scheme_type. is_file ( )
1307
- && segments. len ( ) == 1
1308
- && is_normalized_windows_drive_letter ( segments[ 0 ] )
1309
1302
{
1310
- return ;
1303
+ // If url’s scheme is "file", path’s size is 1, and path[0] is a normalized Windows drive letter, then return.
1304
+ let segments: Vec < & str > = self . serialization [ path_start..]
1305
+ . split ( '/' )
1306
+ . filter ( |s| !s. is_empty ( ) )
1307
+ . collect ( ) ;
1308
+ if scheme_type. is_file ( )
1309
+ && segments. len ( ) == 1
1310
+ && is_normalized_windows_drive_letter ( segments[ 0 ] )
1311
+ {
1312
+ return ;
1313
+ }
1311
1314
}
1312
1315
// Remove path’s last item.
1313
1316
self . pop_path ( scheme_type, path_start) ;
0 commit comments