about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--Cargo.lock4
-rw-r--r--Cargo.toml1
-rw-r--r--crates/ide-completion/src/completions/env_vars.rs4
-rw-r--r--crates/syntax/Cargo.toml2
-rw-r--r--crates/syntax/src/token_text.rs7
-rw-r--r--crates/tt/Cargo.toml2
6 files changed, 14 insertions, 6 deletions
diff --git a/Cargo.lock b/Cargo.lock
index a8f5674efb7..9d082215e85 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -1642,9 +1642,9 @@ checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0"
 
 [[package]]
 name = "smol_str"
-version = "0.1.25"
+version = "0.2.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9d268d24892b932cac466d214af6ec8a3ec99873f0f8664d9a384b49596db682"
+checksum = "74212e6bbe9a4352329b2f68ba3130c15a3f26fe88ff22dbdc6cdd58fa85e99c"
 dependencies = [
  "serde",
 ]
diff --git a/Cargo.toml b/Cargo.toml
index 511cb24a61e..985a1844c73 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -77,6 +77,7 @@ vfs = { path = "./crates/vfs", version = "0.0.0" }
 
 # non-local crates
 smallvec = { version = "1.10.0", features = ["const_new", "union", "const_generics"] }
+smol_str = "0.2.0"
 # the following crates are pinned to prevent us from pulling in syn 2 until all our dependencies have moved
 serde = { version = "=1.0.156", features = ["derive"] }
 serde_json = "1.0.94"
diff --git a/crates/ide-completion/src/completions/env_vars.rs b/crates/ide-completion/src/completions/env_vars.rs
index 1002be21131..c525e0c8076 100644
--- a/crates/ide-completion/src/completions/env_vars.rs
+++ b/crates/ide-completion/src/completions/env_vars.rs
@@ -37,9 +37,9 @@ pub(crate) fn complete_cargo_env_vars(
     guard_env_macro(expanded, &ctx.sema)?;
     let range = expanded.text_range_between_quotes()?;
 
-    CARGO_DEFINED_VARS.iter().for_each(|(var, detail)| {
+    CARGO_DEFINED_VARS.into_iter().for_each(|&(var, detail)| {
         let mut item = CompletionItem::new(CompletionItemKind::Keyword, range, var);
-        item.detail(*detail);
+        item.detail(detail);
         item.add_to(acc);
     });
 
diff --git a/crates/syntax/Cargo.toml b/crates/syntax/Cargo.toml
index 7200df0a573..9109507f75e 100644
--- a/crates/syntax/Cargo.toml
+++ b/crates/syntax/Cargo.toml
@@ -21,7 +21,7 @@ rustc_lexer = { version = "727.0.0", package = "rustc-ap-rustc_lexer" }
 rustc-hash = "1.1.0"
 once_cell = "1.17.0"
 indexmap = "1.9.1"
-smol_str = "0.1.23"
+smol_str.workspace = true
 
 parser.workspace = true
 profile.workspace = true
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
diff --git a/crates/tt/Cargo.toml b/crates/tt/Cargo.toml
index b8469383183..a28ee5f1ca2 100644
--- a/crates/tt/Cargo.toml
+++ b/crates/tt/Cargo.toml
@@ -12,6 +12,6 @@ rust-version.workspace = true
 doctest = false
 
 [dependencies]
-smol_str = "0.1.23"
+smol_str.workspace = true
 
 stdx.workspace = true