File tree 1 file changed +5
-8
lines changed
1 file changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -361,15 +361,12 @@ impl ast::Impl {
361
361
}
362
362
}
363
363
364
- // for `PathSegment` '<i32 as core::ops::Add>', call `first_path_type` will get `i32` and `last_path_type` will get `core::ops::Add`
365
- // for '<&i32 as core::ops::Add>', call `first_path_type` and `last_path_type` will both get `core::ops::Add` cause `&i32` is `Type(RefType)`
364
+ // [#15778](https://github.com/rust-lang/rust-analyzer/issues/15778)
366
365
impl ast:: PathSegment {
367
- pub fn first_path_type ( & self ) -> Option < ast:: PathType > {
368
- self . syntax ( ) . children ( ) . find_map ( ast:: PathType :: cast)
369
- }
370
-
371
- pub fn last_path_type ( & self ) -> Option < ast:: PathType > {
372
- self . syntax ( ) . children ( ) . filter_map ( ast:: PathType :: cast) . last ( )
366
+ pub fn qualifying_trait ( & self ) -> Option < ast:: PathType > {
367
+ let mut path_types = support:: children ( self . syntax ( ) ) ;
368
+ let first = path_types. next ( ) ?;
369
+ path_types. next ( ) . or ( Some ( first) )
373
370
}
374
371
}
375
372
You can’t perform that action at this time.
0 commit comments