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