diff options
Diffstat (limited to 'crates/smol_str')
-rw-r--r-- | crates/smol_str/src/lib.rs | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/crates/smol_str/src/lib.rs b/crates/smol_str/src/lib.rs index 4d5fef593..41c3a39ef 100644 --- a/crates/smol_str/src/lib.rs +++ b/crates/smol_str/src/lib.rs | |||
@@ -1,6 +1,6 @@ | |||
1 | use std::{sync::Arc, ops::Deref}; | 1 | use std::{sync::Arc, ops::Deref, fmt}; |
2 | 2 | ||
3 | #[derive(Clone, Debug)] | 3 | #[derive(Clone)] |
4 | pub struct SmolStr(Repr); | 4 | pub struct SmolStr(Repr); |
5 | 5 | ||
6 | impl SmolStr { | 6 | impl SmolStr { |
@@ -49,6 +49,18 @@ impl<'a> PartialEq<SmolStr> for &'a str { | |||
49 | } | 49 | } |
50 | } | 50 | } |
51 | 51 | ||
52 | impl fmt::Debug for SmolStr { | ||
53 | fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { | ||
54 | fmt::Debug::fmt(self.as_str(), f) | ||
55 | } | ||
56 | } | ||
57 | |||
58 | impl fmt::Display for SmolStr { | ||
59 | fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { | ||
60 | fmt::Display::fmt(self.as_str(), f) | ||
61 | } | ||
62 | } | ||
63 | |||
52 | const INLINE_CAP: usize = 22; | 64 | const INLINE_CAP: usize = 22; |
53 | const WS_TAG: u8 = (INLINE_CAP + 1) as u8; | 65 | const WS_TAG: u8 = (INLINE_CAP + 1) as u8; |
54 | 66 | ||