File tree Expand file tree Collapse file tree 2 files changed +2
-12
lines changed Expand file tree Collapse file tree 2 files changed +2
-12
lines changed Original file line number Diff line number Diff line change @@ -681,11 +681,10 @@ fn path_import_candidate(
681681 Some ( qualifier) => match sema. resolve_path ( & qualifier) {
682682 None => {
683683 if qualifier. first_qualifier ( ) . map_or ( true , |it| sema. resolve_path ( & it) . is_none ( ) ) {
684- let mut qualifier = qualifier
685- . segments_of_this_path_only_rev ( )
684+ let qualifier = qualifier
685+ . segments ( )
686686 . map ( |seg| seg. name_ref ( ) . map ( |name| SmolStr :: new ( name. text ( ) ) ) )
687687 . collect :: < Option < Vec < _ > > > ( ) ?;
688- qualifier. reverse ( ) ;
689688 ImportCandidate :: Path ( PathImportCandidate { qualifier : Some ( qualifier) , name } )
690689 } else {
691690 return None ;
Original file line number Diff line number Diff line change @@ -283,11 +283,6 @@ impl ast::Path {
283283 self . first_qualifier_or_self ( ) . segment ( )
284284 }
285285
286- // FIXME: Check usages of Self::segments, they might be wrong because of the logic of the bloew function
287- pub fn segments_of_this_path_only_rev ( & self ) -> impl Iterator < Item = ast:: PathSegment > + Clone {
288- self . qualifiers_and_self ( ) . filter_map ( |it| it. segment ( ) )
289- }
290-
291286 pub fn segments ( & self ) -> impl Iterator < Item = ast:: PathSegment > + Clone {
292287 let path_range = self . syntax ( ) . text_range ( ) ;
293288 successors ( self . first_segment ( ) , move |p| {
@@ -305,10 +300,6 @@ impl ast::Path {
305300 successors ( self . qualifier ( ) , |p| p. qualifier ( ) )
306301 }
307302
308- pub fn qualifiers_and_self ( & self ) -> impl Iterator < Item = ast:: Path > + Clone {
309- successors ( Some ( self . clone ( ) ) , |p| p. qualifier ( ) )
310- }
311-
312303 pub fn top_path ( & self ) -> ast:: Path {
313304 let mut this = self . clone ( ) ;
314305 while let Some ( path) = this. parent_path ( ) {
You can’t perform that action at this time.
0 commit comments