diff options
author | Aleksey Kladov <[email protected]> | 2018-08-17 20:03:55 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2018-08-17 20:03:55 +0100 |
commit | c7b1be6be345f97d6c4fd9ff3c51a94fb817fa56 (patch) | |
tree | 123b895ad8b2797b3b6ebcceebd36fb375ec7a38 /crates/libsyntax2/src/yellow | |
parent | d3c90ded2b9a4f75e101fa3abc60cd3aebc439c9 (diff) |
Owned
Diffstat (limited to 'crates/libsyntax2/src/yellow')
-rw-r--r-- | crates/libsyntax2/src/yellow/syntax.rs | 9 |
1 files changed, 8 insertions, 1 deletions
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<OwnedRoot> { | |||
51 | } | 51 | } |
52 | 52 | ||
53 | impl<R: TreeRoot> SyntaxNode<R> { | 53 | impl<R: TreeRoot> SyntaxNode<R> { |
54 | pub fn as_ref<'a>(&'a self) -> SyntaxNode<RefRoot<'a>> { | 54 | pub fn borrowed<'a>(&'a self) -> SyntaxNodeRef<'a> { |
55 | SyntaxNode { | 55 | SyntaxNode { |
56 | root: self.root.borrowed(), | 56 | root: self.root.borrowed(), |
57 | red: self.red, | 57 | red: self.red, |
58 | } | 58 | } |
59 | } | 59 | } |
60 | 60 | ||
61 | pub fn owned<'a>(&'a self) -> SyntaxNode { | ||
62 | SyntaxNode { | ||
63 | root: self.root.owned(), | ||
64 | red: self.red, | ||
65 | } | ||
66 | } | ||
67 | |||
61 | pub fn kind(&self) -> SyntaxKind { | 68 | pub fn kind(&self) -> SyntaxKind { |
62 | self.red().green().kind() | 69 | self.red().green().kind() |
63 | } | 70 | } |