From c7b1be6be345f97d6c4fd9ff3c51a94fb817fa56 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 17 Aug 2018 22:03:55 +0300 Subject: Owned --- crates/libsyntax2/src/yellow/syntax.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'crates/libsyntax2/src/yellow/syntax.rs') diff --git a/crates/libsyntax2/src/yellow/syntax.rs b/crates/libsyntax2/src/yellow/syntax.rs index 87e4a159d..8f1b1d79a 100644 --- a/crates/libsyntax2/src/yellow/syntax.rs +++ b/crates/libsyntax2/src/yellow/syntax.rs @@ -51,13 +51,20 @@ impl SyntaxNode { } impl SyntaxNode { - pub fn as_ref<'a>(&'a self) -> SyntaxNode> { + pub fn borrowed<'a>(&'a self) -> SyntaxNodeRef<'a> { SyntaxNode { root: self.root.borrowed(), red: self.red, } } + pub fn owned<'a>(&'a self) -> SyntaxNode { + SyntaxNode { + root: self.root.owned(), + red: self.red, + } + } + pub fn kind(&self) -> SyntaxKind { self.red().green().kind() } -- cgit v1.2.3