Skip to content

Commit

Permalink
Implement Display
Browse files Browse the repository at this point in the history
  • Loading branch information
WilliamRagstad committed Aug 16, 2024
1 parent edd2fd3 commit 4de8af3
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/file/webx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,11 +196,11 @@ pub enum WXBodyType {
// TODO: JSON and TEXT
}

impl ToString for WXBodyType {
fn to_string(&self) -> String {
impl Display for WXBodyType {
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
match self {
WXBodyType::Ts => "ts".to_string(),
WXBodyType::Tsx => "tsx".to_string(),
WXBodyType::Ts => write!(f, "ts"),
WXBodyType::Tsx => write!(f, "tsx"),
}
}
}
Expand All @@ -213,7 +213,7 @@ pub struct WXBody {

impl fmt::Debug for WXBody {
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
write!(f, "```{}\n{}\n```", self.body_type.to_string(), self.body)
write!(f, "```{}\n{}\n```", self.body_type, self.body)
}
}

Expand Down

0 comments on commit 4de8af3

Please sign in to comment.