From d685a9b564fe524865cda5713c527aaeb1ca6b1d Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 1 Nov 2018 13:41:04 +0300 Subject: Use From to get an owned AST --- crates/ra_analysis/src/descriptors/function/imp.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'crates/ra_analysis/src') 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::{ /// TODO: this should return something more type-safe then `SyntaxNode` pub(crate) fn fn_syntax(db: &impl DescriptorDatabase, fn_id: FnId) -> FnDefNode { let syntax = db.resolve_syntax_ptr(fn_id.0); - let fn_def = FnDef::cast(syntax.borrowed()).unwrap(); - FnDefNode::new(fn_def) + FnDef::cast(syntax.borrowed()).unwrap().into() } pub(crate) fn fn_scopes(db: &impl DescriptorDatabase, fn_id: FnId) -> Arc { -- cgit v1.2.3