Skip to content

Commit 59b9884

Browse files
authored
[ISSUE #25]Add Debug for CheetahString (#26)
* [ISSUE #25]Add Debug for CheetahString * fix code style
1 parent 6c77915 commit 59b9884

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/cheetah_string.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
use core::fmt;
12
use std::cmp::Ordering;
23
use std::fmt::Display;
34
use std::hash::Hash;
@@ -253,6 +254,12 @@ impl Display for CheetahString {
253254
}
254255
}
255256

257+
impl std::fmt::Debug for CheetahString {
258+
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
259+
fmt::Debug::fmt(self.as_str(), f)
260+
}
261+
}
262+
256263
/// The `InnerString` enum represents different types of string storage.
257264
///
258265
/// Variants:

0 commit comments

Comments
 (0)