@@ -1218,12 +1218,13 @@ impl<'a> Parser<'a> {
12181218 }
12191219 }
12201220 }
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 ( )
12241224 } else {
1225- & self . serialization [ segment_start..self . serialization . len ( ) ]
1225+ self . serialization [ segment_start..self . serialization . len ( ) ] . to_owned ( )
12261226 } ;
1227+ let segment_before_slash: & str = & before_slash_string;
12271228 match segment_before_slash {
12281229 // If buffer is a double-dot path segment, shorten url’s path,
12291230 ".." | "%2e%2e" | "%2e%2E" | "%2E%2e" | "%2E%2E" | "%2e." | "%2E." | ".%2e"
@@ -1298,16 +1299,18 @@ impl<'a> Parser<'a> {
12981299 if self . serialization . len ( ) <= path_start {
12991300 return ;
13001301 }
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 ] )
13091302 {
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+ }
13111314 }
13121315 // Remove path’s last item.
13131316 self . pop_path ( scheme_type, path_start) ;
0 commit comments