From f590635f57a889bf10dd0c9c2d682f8462df174e Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Mon, 3 Sep 2018 21:48:26 +0300 Subject: faster text len --- crates/libsyntax2/src/yellow/green.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/libsyntax2/src/yellow/green.rs') diff --git a/crates/libsyntax2/src/yellow/green.rs b/crates/libsyntax2/src/yellow/green.rs index dc3186a24..8fb691643 100644 --- a/crates/libsyntax2/src/yellow/green.rs +++ b/crates/libsyntax2/src/yellow/green.rs @@ -31,7 +31,7 @@ impl GreenNode { pub fn text_len(&self) -> TextUnit { match self { - GreenNode::Leaf { text, .. } => TextUnit::of_str(text.as_str()), + GreenNode::Leaf { text, .. } => TextUnit::from(text.len() as u32), GreenNode::Branch(b) => b.text_len(), } } -- cgit v1.2.3