Skip to content

Commit

Permalink
[ISSUE #25]Add Debug for CheetahString (#26)
Browse files Browse the repository at this point in the history
* [ISSUE #25]Add Debug for CheetahString

* fix code style
  • Loading branch information
mxsm authored Nov 10, 2024
1 parent 6c77915 commit 59b9884
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/cheetah_string.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use core::fmt;
use std::cmp::Ordering;
use std::fmt::Display;
use std::hash::Hash;
Expand Down Expand Up @@ -253,6 +254,12 @@ impl Display for CheetahString {
}
}

impl std::fmt::Debug for CheetahString {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
fmt::Debug::fmt(self.as_str(), f)
}
}

/// The `InnerString` enum represents different types of string storage.
///
/// Variants:
Expand Down

0 comments on commit 59b9884

Please sign in to comment.