aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax/src/ptr.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_syntax/src/ptr.rs')
-rw-r--r--crates/ra_syntax/src/ptr.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/crates/ra_syntax/src/ptr.rs b/crates/ra_syntax/src/ptr.rs
index b50cd8a52..13ee1305f 100644
--- a/crates/ra_syntax/src/ptr.rs
+++ b/crates/ra_syntax/src/ptr.rs
@@ -42,7 +42,7 @@ impl SyntaxNodePtr {
42/// Like `SyntaxNodePtr`, but remembers the type of node 42/// Like `SyntaxNodePtr`, but remembers the type of node
43#[derive(Debug, PartialEq, Eq, Hash)] 43#[derive(Debug, PartialEq, Eq, Hash)]
44pub struct AstPtr<N: AstNode> { 44pub struct AstPtr<N: AstNode> {
45 ptr: SyntaxNodePtr, 45 raw: SyntaxNodePtr,
46 _ty: PhantomData<N>, 46 _ty: PhantomData<N>,
47} 47}
48 48
@@ -56,18 +56,18 @@ impl<N: AstNode> Clone for AstPtr<N> {
56impl<N: AstNode> AstPtr<N> { 56impl<N: AstNode> AstPtr<N> {
57 pub fn new(node: &N) -> AstPtr<N> { 57 pub fn new(node: &N) -> AstPtr<N> {
58 AstPtr { 58 AstPtr {
59 ptr: SyntaxNodePtr::new(node.syntax()), 59 raw: SyntaxNodePtr::new(node.syntax()),
60 _ty: PhantomData, 60 _ty: PhantomData,
61 } 61 }
62 } 62 }
63 63
64 pub fn to_node(self, source_file: &SourceFile) -> &N { 64 pub fn to_node(self, source_file: &SourceFile) -> &N {
65 let syntax_node = self.ptr.to_node(source_file); 65 let syntax_node = self.raw.to_node(source_file);
66 N::cast(syntax_node).unwrap() 66 N::cast(syntax_node).unwrap()
67 } 67 }
68 68
69 pub fn syntax_node_ptr(self) -> SyntaxNodePtr { 69 pub fn syntax_node_ptr(self) -> SyntaxNodePtr {
70 self.ptr 70 self.raw
71 } 71 }
72} 72}
73 73