Skip to content

Commit

Permalink
Merge pull request #942 from hove-io/comment_type/display
Browse files Browse the repository at this point in the history
impl Display for CommentType
  • Loading branch information
datanel committed Mar 7, 2024
2 parents 763e4e9 + fe9c2f7 commit e7bbf0a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
authors = ["Hove <[email protected]>", "Guillaume Pinot <[email protected]>"]
name = "transit_model"
version = "0.62.0"
version = "0.62.1"
license = "AGPL-3.0-only"
description = "Transit data management"
repository = "https://github.com/hove-io/transit_model"
Expand Down
14 changes: 14 additions & 0 deletions src/objects.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1413,6 +1413,20 @@ pub enum CommentType {
OnDemandTransport,
}

/// ```
/// # use transit_model::objects::CommentType;
/// assert_eq!(format!("{}", CommentType::Information), "information");
/// assert_eq!(format!("{}", CommentType::OnDemandTransport), "on_demand_transport");
/// ```
impl std::fmt::Display for CommentType {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
match self {
CommentType::Information => write!(f, "information"),
CommentType::OnDemandTransport => write!(f, "on_demand_transport"),
}
}
}

#[derive(Default, Serialize, Deserialize, Debug, Eq, PartialEq)]
pub struct Comment {
#[serde(rename = "comment_id")]
Expand Down

0 comments on commit e7bbf0a

Please sign in to comment.