diff --git a/crates/libsyntax2/Cargo.toml b/crates/libsyntax2/Cargo.toml index abb711febd..030cca2016 100644 --- a/crates/libsyntax2/Cargo.toml +++ b/crates/libsyntax2/Cargo.toml @@ -10,7 +10,7 @@ text_unit = "0.1.4" itertools = "0.7.8" drop_bomb = "0.1.4" parking_lot = "0.6.0" -smol_str = "0.1.4" +smol_str = "0.1.6" [dev-dependencies] test_utils = { path = "../test_utils" } diff --git a/crates/libsyntax2/src/yellow/green.rs b/crates/libsyntax2/src/yellow/green.rs index dc3186a245..8fb6916439 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(), } }