aboutsummaryrefslogtreecommitdiff
path: root/crates/smol_str
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2018-08-13 13:44:51 +0100
committerAleksey Kladov <[email protected]>2018-08-13 13:44:51 +0100
commit0568e76406fc4869152671a255c5e1efca6611a6 (patch)
tree69aba4bb52795539baa05f048cb4329b47953147 /crates/smol_str
parentd19f3ac83441420365bff5e4ce21d1d2175bd8c2 (diff)
smol debug
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