mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-26 20:09:19 +00:00
Bump smol-str
This commit is contained in:
parent
fa3db447d7
commit
1456b53051
6 changed files with 14 additions and 6 deletions
|
@ -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