diff options
| author | Young-Flash <871946895@qq.com> | 2023-11-17 21:31:33 +0800 |
|---|---|---|
| committer | Young-Flash <871946895@qq.com> | 2023-11-17 21:31:33 +0800 |
| commit | 1cbda612bc2d95c14bb0b511c9d8024316dffc8b (patch) | |
| tree | 7394e0134beb9fc5db4023c55bcd9ad70383151e | |
| parent | bc978217b32cd10abd140bec1724a218f43629fb (diff) | |
| download | rust-1cbda612bc2d95c14bb0b511c9d8024316dffc8b.tar.gz rust-1cbda612bc2d95c14bb0b511c9d8024316dffc8b.zip | |
chore: add use case for `PathSegment::qualifying_trait`
| -rw-r--r-- | crates/ide-assists/src/handlers/unqualify_method_call.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/crates/ide-assists/src/handlers/unqualify_method_call.rs b/crates/ide-assists/src/handlers/unqualify_method_call.rs index 0bf1782a489..0876246e90b 100644 --- a/crates/ide-assists/src/handlers/unqualify_method_call.rs +++ b/crates/ide-assists/src/handlers/unqualify_method_call.rs @@ -91,7 +91,7 @@ fn add_import( ) { if let Some(path_segment) = qualifier.segment() { // for `<i32 as std::ops::Add>` - let path_type = path_segment.syntax().children().filter_map(ast::PathType::cast).last(); + let path_type = path_segment.qualifying_trait(); let import = match path_type { Some(it) => { if let Some(path) = it.path() { |
