From 2d3940d0ab862dbfaed4f4c844faaca6a38e31e9 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 11 Jan 2019 19:59:06 +0300 Subject: rename TreePtr -> TreeArc This is much clearer about the semantics --- crates/ra_syntax/src/yellow.rs | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'crates/ra_syntax/src/yellow.rs') diff --git a/crates/ra_syntax/src/yellow.rs b/crates/ra_syntax/src/yellow.rs index 1bf1806b9..93621d08a 100644 --- a/crates/ra_syntax/src/yellow.rs +++ b/crates/ra_syntax/src/yellow.rs @@ -21,23 +21,23 @@ impl Types for RaTypes { pub type GreenNode = rowan::GreenNode; #[derive(PartialEq, Eq, Hash)] -pub struct TreePtr>>( - pub(crate) rowan::TreePtr, +pub struct TreeArc>>( + pub(crate) rowan::TreeArc, ); -impl TreePtr +impl TreeArc where T: TransparentNewType>, { - pub(crate) fn cast(this: TreePtr) -> TreePtr + pub(crate) fn cast(this: TreeArc) -> TreeArc where U: TransparentNewType>, { - TreePtr(rowan::TreePtr::cast(this.0)) + TreeArc(rowan::TreeArc::cast(this.0)) } } -impl std::ops::Deref for TreePtr +impl std::ops::Deref for TreeArc where T: TransparentNewType>, { @@ -47,7 +47,7 @@ where } } -impl PartialEq for TreePtr +impl PartialEq for TreeArc where T: TransparentNewType>, T: PartialEq, @@ -58,16 +58,16 @@ where } } -impl Clone for TreePtr +impl Clone for TreeArc where T: TransparentNewType>, { - fn clone(&self) -> TreePtr { - TreePtr(self.0.clone()) + fn clone(&self) -> TreeArc { + TreeArc(self.0.clone()) } } -impl fmt::Debug for TreePtr +impl fmt::Debug for TreeArc where T: TransparentNewType>, T: fmt::Debug, @@ -85,9 +85,9 @@ unsafe impl TransparentNewType for SyntaxNode { } impl SyntaxNode { - pub(crate) fn new(green: GreenNode, errors: Vec) -> TreePtr { - let ptr = TreePtr(rowan::SyntaxNode::new(green, errors)); - TreePtr::cast(ptr) + pub(crate) fn new(green: GreenNode, errors: Vec) -> TreeArc { + let ptr = TreeArc(rowan::SyntaxNode::new(green, errors)); + TreeArc::cast(ptr) } } @@ -131,9 +131,9 @@ impl SyntaxNode { pub(crate) fn replace_with(&self, replacement: GreenNode) -> GreenNode { self.0.replace_self(replacement) } - pub fn to_owned(&self) -> TreePtr { - let ptr = TreePtr(self.0.to_owned()); - TreePtr::cast(ptr) + pub fn to_owned(&self) -> TreeArc { + let ptr = TreeArc(self.0.to_owned()); + TreeArc::cast(ptr) } pub fn kind(&self) -> SyntaxKind { self.0.kind() -- cgit v1.2.3