aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_assists/src
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_assists/src')
-rw-r--r--crates/ra_assists/src/ast_transform.rs2
-rw-r--r--crates/ra_assists/src/utils.rs7
2 files changed, 3 insertions, 6 deletions
diff --git a/crates/ra_assists/src/ast_transform.rs b/crates/ra_assists/src/ast_transform.rs
index 0a7be87a0..28f3f3546 100644
--- a/crates/ra_assists/src/ast_transform.rs
+++ b/crates/ra_assists/src/ast_transform.rs
@@ -81,7 +81,7 @@ impl<'a> SubstituteTypeParams<'a> {
81 // FIXME: It would probably be nicer if we could get this via HIR (i.e. get the 81 // FIXME: It would probably be nicer if we could get this via HIR (i.e. get the
82 // trait ref, and then go from the types in the substs back to the syntax). 82 // trait ref, and then go from the types in the substs back to the syntax).
83 fn get_syntactic_substs(impl_def: ast::Impl) -> Option<Vec<ast::Type>> { 83 fn get_syntactic_substs(impl_def: ast::Impl) -> Option<Vec<ast::Type>> {
84 let target_trait = impl_def.target_trait()?; 84 let target_trait = impl_def.trait_()?;
85 let path_type = match target_trait { 85 let path_type = match target_trait {
86 ast::Type::PathType(path) => path, 86 ast::Type::PathType(path) => path,
87 _ => return None, 87 _ => return None,
diff --git a/crates/ra_assists/src/utils.rs b/crates/ra_assists/src/utils.rs
index bb16ebd4e..373de273c 100644
--- a/crates/ra_assists/src/utils.rs
+++ b/crates/ra_assists/src/utils.rs
@@ -111,11 +111,8 @@ pub(crate) fn resolve_target_trait(
111 sema: &Semantics<RootDatabase>, 111 sema: &Semantics<RootDatabase>,
112 impl_def: &ast::Impl, 112 impl_def: &ast::Impl,
113) -> Option<hir::Trait> { 113) -> Option<hir::Trait> {
114 let ast_path = impl_def 114 let ast_path =
115 .target_trait() 115 impl_def.trait_().map(|it| it.syntax().clone()).and_then(ast::PathType::cast)?.path()?;
116 .map(|it| it.syntax().clone())
117 .and_then(ast::PathType::cast)?
118 .path()?;
119 116
120 match sema.resolve_path(&ast_path) { 117 match sema.resolve_path(&ast_path) {
121 Some(hir::PathResolution::Def(hir::ModuleDef::Trait(def))) => Some(def), 118 Some(hir::PathResolution::Def(hir::ModuleDef::Trait(def))) => Some(def),