File tree 2 files changed +2
-12
lines changed
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(
681
681
Some ( qualifier) => match sema. resolve_path ( & qualifier) {
682
682
None => {
683
683
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 ( )
686
686
. map ( |seg| seg. name_ref ( ) . map ( |name| SmolStr :: new ( name. text ( ) ) ) )
687
687
. collect :: < Option < Vec < _ > > > ( ) ?;
688
- qualifier. reverse ( ) ;
689
688
ImportCandidate :: Path ( PathImportCandidate { qualifier : Some ( qualifier) , name } )
690
689
} else {
691
690
return None ;
Original file line number Diff line number Diff line change @@ -283,11 +283,6 @@ impl ast::Path {
283
283
self . first_qualifier_or_self ( ) . segment ( )
284
284
}
285
285
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
-
291
286
pub fn segments ( & self ) -> impl Iterator < Item = ast:: PathSegment > + Clone {
292
287
let path_range = self . syntax ( ) . text_range ( ) ;
293
288
successors ( self . first_segment ( ) , move |p| {
@@ -305,10 +300,6 @@ impl ast::Path {
305
300
successors ( self . qualifier ( ) , |p| p. qualifier ( ) )
306
301
}
307
302
308
- pub fn qualifiers_and_self ( & self ) -> impl Iterator < Item = ast:: Path > + Clone {
309
- successors ( Some ( self . clone ( ) ) , |p| p. qualifier ( ) )
310
- }
311
-
312
303
pub fn top_path ( & self ) -> ast:: Path {
313
304
let mut this = self . clone ( ) ;
314
305
while let Some ( path) = this. parent_path ( ) {
You can’t perform that action at this time.
0 commit comments