From 2e354f480b0b83debc06a4311a9709cd8c0df305 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 25 Jan 2019 02:09:31 +0300 Subject: use ToOwned trait instead of inherent method --- crates/ra_syntax/src/ast.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'crates/ra_syntax/src/ast.rs') diff --git a/crates/ra_syntax/src/ast.rs b/crates/ra_syntax/src/ast.rs index bcbd4c60c..b92cc082e 100644 --- a/crates/ra_syntax/src/ast.rs +++ b/crates/ra_syntax/src/ast.rs @@ -15,12 +15,13 @@ use crate::{ /// conversion itself has zero runtime cost: ast and syntax nodes have exactly /// the same representation: a pointer to the tree root and a pointer to the /// node itself. -pub trait AstNode: rowan::TransparentNewType> { +pub trait AstNode: + rowan::TransparentNewType> + ToOwned> +{ fn cast(syntax: &SyntaxNode) -> Option<&Self> where Self: Sized; fn syntax(&self) -> &SyntaxNode; - fn to_owned(&self) -> TreeArc; } pub trait AstToken: AstNode { -- cgit v1.2.3