mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-25 20:43:21 +00:00
smol debug
This commit is contained in:
parent
d19f3ac834
commit
0568e76406
1 changed files with 14 additions and 2 deletions
|
@ -1,6 +1,6 @@
|
|||
use std::{sync::Arc, ops::Deref};
|
||||
use std::{sync::Arc, ops::Deref, fmt};
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
#[derive(Clone)]
|
||||
pub struct SmolStr(Repr);
|
||||
|
||||
impl SmolStr {
|
||||
|
@ -49,6 +49,18 @@ impl<'a> PartialEq<SmolStr> for &'a str {
|
|||
}
|
||||
}
|
||||
|
||||
impl fmt::Debug for SmolStr {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fmt::Debug::fmt(self.as_str(), f)
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Display for SmolStr {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fmt::Display::fmt(self.as_str(), f)
|
||||
}
|
||||
}
|
||||
|
||||
const INLINE_CAP: usize = 22;
|
||||
const WS_TAG: u8 = (INLINE_CAP + 1) as u8;
|
||||
|
||||
|
|
Loading…
Reference in a new issue