@@ -1235,12 +1235,13 @@ impl<'a> Parser<'a> {
12351235 }
12361236 }
12371237 }
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 ( )
12411241 } else {
1242- & self . serialization [ segment_start..self . serialization . len ( ) ]
1242+ self . serialization [ segment_start..self . serialization . len ( ) ] . to_owned ( )
12431243 } ;
1244+ let segment_before_slash: & str = & before_slash_string;
12441245 match segment_before_slash {
12451246 // If buffer is a double-dot path segment, shorten url’s path,
12461247 ".." | "%2e%2e" | "%2e%2E" | "%2E%2e" | "%2E%2E" | "%2e." | "%2E." | ".%2e"
@@ -1315,16 +1316,18 @@ impl<'a> Parser<'a> {
13151316 if self . serialization . len ( ) <= path_start {
13161317 return ;
13171318 }
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 ] )
13261319 {
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+ }
13281331 }
13291332 // Remove path’s last item.
13301333 self . pop_path ( scheme_type, path_start) ;
0 commit comments