aboutsummaryrefslogtreecommitdiff
path: root/crates/smol_str
diff options
context:
space:
mode:
Diffstat (limited to 'crates/smol_str')
-rw-r--r--crates/smol_str/src/lib.rs16
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 @@
1use std::{sync::Arc, ops::Deref}; 1use std::{sync::Arc, ops::Deref, fmt};
2 2
3#[derive(Clone, Debug)] 3#[derive(Clone)]
4pub struct SmolStr(Repr); 4pub struct SmolStr(Repr);
5 5
6impl SmolStr { 6impl SmolStr {
@@ -49,6 +49,18 @@ impl<'a> PartialEq<SmolStr> for &'a str {
49 } 49 }
50} 50}
51 51
52impl 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
58impl 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
52const INLINE_CAP: usize = 22; 64const INLINE_CAP: usize = 22;
53const WS_TAG: u8 = (INLINE_CAP + 1) as u8; 65const WS_TAG: u8 = (INLINE_CAP + 1) as u8;
54 66