mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 22:31:43 +00:00
Bump smol-str
This commit is contained in:
parent
fa3db447d7
commit
1456b53051
6 changed files with 14 additions and 6 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue