@@ -1229,12 +1229,13 @@ impl<'a> Parser<'a> {
12291229 }
12301230 }
12311231 }
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 ( )
12351235 } else {
1236- & self . serialization [ segment_start..self . serialization . len ( ) ]
1236+ self . serialization [ segment_start..self . serialization . len ( ) ] . to_owned ( )
12371237 } ;
1238+ let segment_before_slash: & str = & before_slash_string;
12381239 match segment_before_slash {
12391240 // If buffer is a double-dot path segment, shorten url’s path,
12401241 ".." | "%2e%2e" | "%2e%2E" | "%2E%2e" | "%2E%2E" | "%2e." | "%2E." | ".%2e"
@@ -1307,16 +1308,18 @@ impl<'a> Parser<'a> {
13071308 if self . serialization . len ( ) == path_start {
13081309 return ;
13091310 }
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 ] )
13181311 {
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+ }
13201323 }
13211324 // Remove path’s last item.
13221325 self . pop_path ( scheme_type, path_start) ;
0 commit comments