Simplify API

This commit is contained in:
Aleksey Kladov
2018-08-28 14:07:41 +03:00
parent 7e74af3226
commit 288c9d1ac6
2 changed files with 1 additions and 5 deletions
-4
View File
@@ -43,10 +43,6 @@ pub fn children(&self) -> &[GreenNode] {
}
}
pub fn leaf_text(&self) -> Option<SmolStr> {
self.leaf_text_ref().map(Clone::clone)
}
pub fn leaf_text_ref(&self) -> Option<&SmolStr> {
match self {
GreenNode::Leaf { text, .. } => Some(text),
+1 -1
View File
@@ -153,7 +153,7 @@ pub fn is_leaf(&self) -> bool {
}
pub fn leaf_text(&self) -> Option<SmolStr> {
self.red().green().leaf_text()
self.borrowed().leaf_text_ref().map(|it| it.clone())
}
pub(crate) fn replace_with(&self, green: GreenNode) -> GreenNode {