Bump smol-str

This commit is contained in:
Lukas Wirth 2023-04-11 14:05:22 +02:00
parent fa3db447d7
commit 1456b53051
6 changed files with 14 additions and 6 deletions

View file

@ -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