mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-12 21:28:51 +00:00
Simplify API
This commit is contained in:
parent
7e74af3226
commit
288c9d1ac6
2 changed files with 1 additions and 5 deletions
|
@ -43,10 +43,6 @@ impl 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),
|
||||
|
|
|
@ -153,7 +153,7 @@ impl<R: TreeRoot> SyntaxNode<R> {
|
|||
}
|
||||
|
||||
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 {
|
||||
|
|
Loading…
Reference in a new issue