about summary refs log tree commit diff
path: root/crates/syntax/src
diff options
context:
space:
mode:
authorhecatia-elegua <108802164+hecatia-elegua@users.noreply.github.com>2023-04-11 21:14:52 +0200
committerGitHub <noreply@github.com>2023-04-11 21:14:52 +0200
commit398af0259f7614ff8a0d603edd5d94ce9aecd5f2 (patch)
tree207fc25b5c6d73d5c7833fab11d24d2fa5a837d7 /crates/syntax/src
parent33ee157f3b05865984957953df21f4711f8e5cd6 (diff)
parent7501d3b721560637e27f904d9fce79182c41bef7 (diff)
downloadrust-398af0259f7614ff8a0d603edd5d94ce9aecd5f2.tar.gz
rust-398af0259f7614ff8a0d603edd5d94ce9aecd5f2.zip
Merge branch 'master' into alias-based-completion2
Diffstat (limited to 'crates/syntax/src')
-rw-r--r--crates/syntax/src/token_text.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/crates/syntax/src/token_text.rs b/crates/syntax/src/token_text.rs
index 913b24d42bc..09c080c0c23 100644
--- a/crates/syntax/src/token_text.rs
+++ b/crates/syntax/src/token_text.rs
@@ -3,6 +3,7 @@
 use std::{cmp::Ordering, fmt, ops};
 
 use rowan::GreenToken;
+use smol_str::SmolStr;
 
 pub struct TokenText<'a>(pub(crate) Repr<'a>);
 
@@ -47,6 +48,12 @@ impl From<TokenText<'_>> for String {
     }
 }
 
+impl From<TokenText<'_>> for SmolStr {
+    fn from(token_text: TokenText<'_>) -> Self {
+        SmolStr::new(token_text.as_str())
+    }
+}
+
 impl PartialEq<&'_ str> for TokenText<'_> {
     fn eq(&self, other: &&str) -> bool {
         self.as_str() == *other