diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2019-11-24 17:54:14 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2019-11-24 17:54:14 +0000 |
commit | 64fc9ac9650afb04a353ba8a18381f0db83cbc82 (patch) | |
tree | 18e4c33b4ca4dfbf8ea8a797bfb7b856865b21c8 /crates/ra_hir/src/from_source.rs | |
parent | a58db5712f4fc82845e9397f728815d389c3c38b (diff) | |
parent | e48430cbae32249e50dda1b39e0c98a31f118250 (diff) |
Merge #2390
2390: Simplify r=matklad a=matklad
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_hir/src/from_source.rs')
-rw-r--r-- | crates/ra_hir/src/from_source.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/crates/ra_hir/src/from_source.rs b/crates/ra_hir/src/from_source.rs index f506bba70..72d059a27 100644 --- a/crates/ra_hir/src/from_source.rs +++ b/crates/ra_hir/src/from_source.rs | |||
@@ -9,9 +9,9 @@ use ra_syntax::{ | |||
9 | 9 | ||
10 | use crate::{ | 10 | use crate::{ |
11 | db::{AstDatabase, DefDatabase, HirDatabase}, | 11 | db::{AstDatabase, DefDatabase, HirDatabase}, |
12 | AssocItem, Const, DefWithBody, Enum, EnumVariant, FieldSource, Function, HasBody, HasSource, | 12 | AssocItem, Const, DefWithBody, Enum, EnumVariant, FieldSource, Function, HasSource, ImplBlock, |
13 | ImplBlock, Local, MacroDef, Module, ModuleDef, ModuleSource, Source, Static, Struct, | 13 | Local, MacroDef, Module, ModuleDef, ModuleSource, Source, Static, Struct, StructField, Trait, |
14 | StructField, Trait, TypeAlias, Union, VariantDef, | 14 | TypeAlias, Union, VariantDef, |
15 | }; | 15 | }; |
16 | 16 | ||
17 | pub trait FromSource: Sized { | 17 | pub trait FromSource: Sized { |
@@ -221,7 +221,7 @@ impl Local { | |||
221 | }; | 221 | }; |
222 | Some(res) | 222 | Some(res) |
223 | })?; | 223 | })?; |
224 | let source_map = parent.body_source_map(db); | 224 | let (_body, source_map) = db.body_with_source_map(parent.into()); |
225 | let src = src.map(ast::Pat::from); | 225 | let src = src.map(ast::Pat::from); |
226 | let pat_id = source_map.node_pat(src.as_ref())?; | 226 | let pat_id = source_map.node_pat(src.as_ref())?; |
227 | Some(Local { parent, pat_id }) | 227 | Some(Local { parent, pat_id }) |