diff options
author | Aleksey Kladov <[email protected]> | 2018-11-01 10:41:04 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2018-11-01 10:41:20 +0000 |
commit | d685a9b564fe524865cda5713c527aaeb1ca6b1d (patch) | |
tree | 67908a8602d4eee25d78d6b467df8d431e29950c /crates/ra_analysis/src/descriptors/function | |
parent | 3ec9f958b39b23b945dd60088843d19fe6cef2d7 (diff) |
Use From to get an owned AST
Diffstat (limited to 'crates/ra_analysis/src/descriptors/function')
-rw-r--r-- | crates/ra_analysis/src/descriptors/function/imp.rs | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/crates/ra_analysis/src/descriptors/function/imp.rs b/crates/ra_analysis/src/descriptors/function/imp.rs index 11fffeefc..755e05819 100644 --- a/crates/ra_analysis/src/descriptors/function/imp.rs +++ b/crates/ra_analysis/src/descriptors/function/imp.rs | |||
@@ -11,8 +11,7 @@ use crate::descriptors::{ | |||
11 | /// TODO: this should return something more type-safe then `SyntaxNode` | 11 | /// TODO: this should return something more type-safe then `SyntaxNode` |
12 | pub(crate) fn fn_syntax(db: &impl DescriptorDatabase, fn_id: FnId) -> FnDefNode { | 12 | pub(crate) fn fn_syntax(db: &impl DescriptorDatabase, fn_id: FnId) -> FnDefNode { |
13 | let syntax = db.resolve_syntax_ptr(fn_id.0); | 13 | let syntax = db.resolve_syntax_ptr(fn_id.0); |
14 | let fn_def = FnDef::cast(syntax.borrowed()).unwrap(); | 14 | FnDef::cast(syntax.borrowed()).unwrap().into() |
15 | FnDefNode::new(fn_def) | ||
16 | } | 15 | } |
17 | 16 | ||
18 | pub(crate) fn fn_scopes(db: &impl DescriptorDatabase, fn_id: FnId) -> Arc<FnScopes> { | 17 | pub(crate) fn fn_scopes(db: &impl DescriptorDatabase, fn_id: FnId) -> Arc<FnScopes> { |