diff options
author | Aleksey Kladov <[email protected]> | 2019-12-12 13:58:04 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-12-12 13:58:04 +0000 |
commit | f135a8ea55c0a46c67713fb3b79b5f62ada430c1 (patch) | |
tree | a71a0c4da21cb40c35b6aed842d9664cbec8a59d /crates/ra_hir/src/from_source.rs | |
parent | 63c192b34a54e826afebc735ca6225b44a876eab (diff) |
Move structs to new loc
Diffstat (limited to 'crates/ra_hir/src/from_source.rs')
-rw-r--r-- | crates/ra_hir/src/from_source.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/crates/ra_hir/src/from_source.rs b/crates/ra_hir/src/from_source.rs index 091349d49..978326c74 100644 --- a/crates/ra_hir/src/from_source.rs +++ b/crates/ra_hir/src/from_source.rs | |||
@@ -23,8 +23,10 @@ pub trait FromSource: Sized { | |||
23 | impl FromSource for Struct { | 23 | impl FromSource for Struct { |
24 | type Ast = ast::StructDef; | 24 | type Ast = ast::StructDef; |
25 | fn from_source(db: &(impl DefDatabase + AstDatabase), src: InFile<Self::Ast>) -> Option<Self> { | 25 | fn from_source(db: &(impl DefDatabase + AstDatabase), src: InFile<Self::Ast>) -> Option<Self> { |
26 | let id = from_source(db, src)?; | 26 | analyze_container(db, src.as_ref().map(|it| it.syntax()))[keys::STRUCT] |
27 | Some(Struct { id }) | 27 | .get(&src) |
28 | .copied() | ||
29 | .map(Struct::from) | ||
28 | } | 30 | } |
29 | } | 31 | } |
30 | impl FromSource for Union { | 32 | impl FromSource for Union { |