smol_str to a crate

This commit is contained in:
Aleksey Kladov
2018-08-13 14:24:22 +03:00
parent 18486a02fa
commit ed2ac17133
11 changed files with 101 additions and 23 deletions

View File

@@ -1,6 +1,9 @@
mod generated;
use std::sync::Arc;
use smol_str::SmolStr;
use {
SyntaxNode, SyntaxRoot, TreeRoot, SyntaxError,
SyntaxKind::*,
@@ -64,7 +67,9 @@ impl<R: TreeRoot> Function<R> {
}
impl<R: TreeRoot> Name<R> {
pub fn text(&self) -> String {
self.syntax().text()
pub fn text(&self) -> SmolStr {
let ident = self.syntax().first_child()
.unwrap();
ident.leaf_text().unwrap()
}
}