aboutsummaryrefslogtreecommitdiff
path: root/crates/libsyntax2
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2018-09-03 19:48:26 +0100
committerAleksey Kladov <[email protected]>2018-09-03 19:48:26 +0100
commitf590635f57a889bf10dd0c9c2d682f8462df174e (patch)
tree83cf0d3f29289781d0b08f9b6e032529a8c3c533 /crates/libsyntax2
parent5ba645c0094c79d9aab527f0396fdad3e99bef3b (diff)
faster text len
Diffstat (limited to 'crates/libsyntax2')
-rw-r--r--crates/libsyntax2/Cargo.toml2
-rw-r--r--crates/libsyntax2/src/yellow/green.rs2
2 files changed, 2 insertions, 2 deletions
diff --git a/crates/libsyntax2/Cargo.toml b/crates/libsyntax2/Cargo.toml
index abb711feb..030cca201 100644
--- a/crates/libsyntax2/Cargo.toml
+++ b/crates/libsyntax2/Cargo.toml
@@ -10,7 +10,7 @@ text_unit = "0.1.4"
10itertools = "0.7.8" 10itertools = "0.7.8"
11drop_bomb = "0.1.4" 11drop_bomb = "0.1.4"
12parking_lot = "0.6.0" 12parking_lot = "0.6.0"
13smol_str = "0.1.4" 13smol_str = "0.1.6"
14 14
15[dev-dependencies] 15[dev-dependencies]
16test_utils = { path = "../test_utils" } 16test_utils = { path = "../test_utils" }
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 {
31 31
32 pub fn text_len(&self) -> TextUnit { 32 pub fn text_len(&self) -> TextUnit {
33 match self { 33 match self {
34 GreenNode::Leaf { text, .. } => TextUnit::of_str(text.as_str()), 34 GreenNode::Leaf { text, .. } => TextUnit::from(text.len() as u32),
35 GreenNode::Branch(b) => b.text_len(), 35 GreenNode::Branch(b) => b.text_len(),
36 } 36 }
37 } 37 }