aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-01-24 10:40:36 +0000
committerAleksey Kladov <[email protected]>2019-01-24 10:40:36 +0000
commita00570d7a3645c5883da120720161561be169478 (patch)
treecd51ddf26f7c9ce29a6d3fdaa3be88dfb88e3c9d /crates
parentcfb085ded8d61d7b744d0a83ecbb3da254f6ab9f (diff)
minor rename
Diffstat (limited to 'crates')
-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