smol_str to a crate
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
use std::{fmt, sync::Arc};
|
||||
|
||||
use smol_str::SmolStr;
|
||||
|
||||
use {
|
||||
yellow::{RedNode, TreeRoot, SyntaxRoot, RedPtr},
|
||||
SyntaxKind::{self, *},
|
||||
@@ -116,6 +118,10 @@ impl<R: TreeRoot> SyntaxNode<R> {
|
||||
self.first_child().is_none()
|
||||
}
|
||||
|
||||
pub fn leaf_text(&self) -> Option<SmolStr> {
|
||||
self.red().green().leaf_text()
|
||||
}
|
||||
|
||||
fn red(&self) -> &RedNode {
|
||||
unsafe { self.red.get(&self.root) }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user