aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-06-11 15:48:27 +0100
committerAleksey Kladov <[email protected]>2019-06-11 16:28:51 +0100
commitdd63f17027d5c873a5782dcbb08e9b068fc8ee00 (patch)
tree925ed48be65afe9d534332db57f486fa8cf60e73 /crates/ra_hir/src
parent0145d06515d990f8b7bf45e261674c265c52d858 (diff)
use Source for module, part 2
Diffstat (limited to 'crates/ra_hir/src')
-rw-r--r--crates/ra_hir/src/code_model.rs4
-rw-r--r--crates/ra_hir/src/docs.rs2
2 files changed, 3 insertions, 3 deletions
diff --git a/crates/ra_hir/src/code_model.rs b/crates/ra_hir/src/code_model.rs
index e920256e5..1a33127fa 100644
--- a/crates/ra_hir/src/code_model.rs
+++ b/crates/ra_hir/src/code_model.rs
@@ -210,11 +210,11 @@ impl Module {
210 pub fn declaration_source( 210 pub fn declaration_source(
211 self, 211 self,
212 db: &(impl DefDatabase + AstDatabase), 212 db: &(impl DefDatabase + AstDatabase),
213 ) -> Option<(HirFileId, TreeArc<ast::Module>)> { 213 ) -> Option<Source<TreeArc<ast::Module>>> {
214 let def_map = db.crate_def_map(self.krate); 214 let def_map = db.crate_def_map(self.krate);
215 let decl = def_map[self.module_id].declaration?; 215 let decl = def_map[self.module_id].declaration?;
216 let ast = decl.to_node(db); 216 let ast = decl.to_node(db);
217 Some((decl.file_id(), ast)) 217 Some((decl.file_id(), ast).into())
218 } 218 }
219 219
220 /// Returns the syntax of the last path segment corresponding to this import 220 /// Returns the syntax of the last path segment corresponding to this import
diff --git a/crates/ra_hir/src/docs.rs b/crates/ra_hir/src/docs.rs
index ae82d55a5..4db066c43 100644
--- a/crates/ra_hir/src/docs.rs
+++ b/crates/ra_hir/src/docs.rs
@@ -71,7 +71,7 @@ pub(crate) fn documentation_query(
71 def: DocDef, 71 def: DocDef,
72) -> Option<Documentation> { 72) -> Option<Documentation> {
73 match def { 73 match def {
74 DocDef::Module(it) => docs_from_ast(&*it.declaration_source(db)?.1), 74 DocDef::Module(it) => docs_from_ast(&*it.declaration_source(db)?.ast),
75 DocDef::StructField(it) => match it.source(db).ast { 75 DocDef::StructField(it) => match it.source(db).ast {
76 FieldSource::Named(named) => docs_from_ast(&*named), 76 FieldSource::Named(named) => docs_from_ast(&*named),
77 FieldSource::Pos(..) => return None, 77 FieldSource::Pos(..) => return None,