From e48430cbae32249e50dda1b39e0c98a31f118250 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sun, 24 Nov 2019 20:53:42 +0300 Subject: Simplify --- crates/ra_hir/src/from_source.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'crates/ra_hir/src/from_source.rs') 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::{ use crate::{ db::{AstDatabase, DefDatabase, HirDatabase}, - AssocItem, Const, DefWithBody, Enum, EnumVariant, FieldSource, Function, HasBody, HasSource, - ImplBlock, Local, MacroDef, Module, ModuleDef, ModuleSource, Source, Static, Struct, - StructField, Trait, TypeAlias, Union, VariantDef, + AssocItem, Const, DefWithBody, Enum, EnumVariant, FieldSource, Function, HasSource, ImplBlock, + Local, MacroDef, Module, ModuleDef, ModuleSource, Source, Static, Struct, StructField, Trait, + TypeAlias, Union, VariantDef, }; pub trait FromSource: Sized { @@ -221,7 +221,7 @@ impl Local { }; Some(res) })?; - let source_map = parent.body_source_map(db); + let (_body, source_map) = db.body_with_source_map(parent.into()); let src = src.map(ast::Pat::from); let pat_id = source_map.node_pat(src.as_ref())?; Some(Local { parent, pat_id }) -- cgit v1.2.3