Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide-db/src/path_transform.rs')
-rw-r--r--crates/ide-db/src/path_transform.rs3
1 files changed, 1 insertions, 2 deletions
diff --git a/crates/ide-db/src/path_transform.rs b/crates/ide-db/src/path_transform.rs
index 3fd1505772..2a0a28a9ac 100644
--- a/crates/ide-db/src/path_transform.rs
+++ b/crates/ide-db/src/path_transform.rs
@@ -451,8 +451,7 @@ impl Ctx<'_> {
};
let found_path = self.target_module.find_path(self.source_scope.db, def, cfg)?;
let res = mod_path_to_ast(&found_path, self.target_edition);
- let (mut res_editor, res) = SyntaxEditor::new(res.syntax().clone());
- let res = ast::Path::cast(res).unwrap();
+ let (mut res_editor, res) = SyntaxEditor::new_typed(&res);
if let Some(args) = path.segment().and_then(|it| it.generic_arg_list())
&& let Some(segment) = res.segment()
{