From 1cbda612bc2d95c14bb0b511c9d8024316dffc8b Mon Sep 17 00:00:00 2001 From: Young-Flash <871946895@qq.com> Date: Fri, 17 Nov 2023 21:31:33 +0800 Subject: [PATCH] chore: add use case for `PathSegment::qualifying_trait` --- crates/ide-assists/src/handlers/unqualify_method_call.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 `` - 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() {