mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 22:54:58 +00:00
smol_str to a crate
This commit is contained in:
parent
18486a02fa
commit
ed2ac17133
11 changed files with 101 additions and 23 deletions
|
@ -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) }
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue