Skip to content

Commit a1af8bb

Browse files
committed
Auto merge of rust-lang#14548 - Veykril:smol-str, r=Veykril
minor: Bump smol-str
2 parents 7afd204 + 1456b53 commit a1af8bb

File tree

6 files changed

+14
-6
lines changed

6 files changed

+14
-6
lines changed

Cargo.lock

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ vfs = { path = "./crates/vfs", version = "0.0.0" }
7777

7878
# non-local crates
7979
smallvec = { version = "1.10.0", features = ["const_new", "union", "const_generics"] }
80+
smol_str = "0.2.0"
8081
# the following crates are pinned to prevent us from pulling in syn 2 until all our dependencies have moved
8182
serde = { version = "=1.0.156", features = ["derive"] }
8283
serde_json = "1.0.94"

crates/ide-completion/src/completions/env_vars.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ pub(crate) fn complete_cargo_env_vars(
3737
guard_env_macro(expanded, &ctx.sema)?;
3838
let range = expanded.text_range_between_quotes()?;
3939

40-
CARGO_DEFINED_VARS.iter().for_each(|(var, detail)| {
40+
CARGO_DEFINED_VARS.into_iter().for_each(|&(var, detail)| {
4141
let mut item = CompletionItem::new(CompletionItemKind::Keyword, range, var);
42-
item.detail(*detail);
42+
item.detail(detail);
4343
item.add_to(acc);
4444
});
4545

crates/syntax/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ rustc_lexer = { version = "727.0.0", package = "rustc-ap-rustc_lexer" }
2121
rustc-hash = "1.1.0"
2222
once_cell = "1.17.0"
2323
indexmap = "1.9.1"
24-
smol_str = "0.1.23"
24+
smol_str.workspace = true
2525

2626
parser.workspace = true
2727
profile.workspace = true

crates/syntax/src/token_text.rs

+7
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
use std::{cmp::Ordering, fmt, ops};
44

55
use rowan::GreenToken;
6+
use smol_str::SmolStr;
67

78
pub struct TokenText<'a>(pub(crate) Repr<'a>);
89

@@ -47,6 +48,12 @@ impl From<TokenText<'_>> for String {
4748
}
4849
}
4950

51+
impl From<TokenText<'_>> for SmolStr {
52+
fn from(token_text: TokenText<'_>) -> Self {
53+
SmolStr::new(token_text.as_str())
54+
}
55+
}
56+
5057
impl PartialEq<&'_ str> for TokenText<'_> {
5158
fn eq(&self, other: &&str) -> bool {
5259
self.as_str() == *other

crates/tt/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ rust-version.workspace = true
1212
doctest = false
1313

1414
[dependencies]
15-
smol_str = "0.1.23"
15+
smol_str.workspace = true
1616

1717
stdx.workspace = true

0 commit comments

Comments
 (0)