mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 12:54:58 +00:00
Simplify
This commit is contained in:
parent
d157812cd1
commit
e48430cbae
8 changed files with 30 additions and 104 deletions
|
@ -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 })
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue