diff --git a/Cargo.toml b/Cargo.toml index 78ddc9f2c..56a9e0580 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] authors = ["Hove ", "Guillaume Pinot "] 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" diff --git a/src/objects.rs b/src/objects.rs index 6e17113c3..2bcc2b9c0 100644 --- a/src/objects.rs +++ b/src/objects.rs @@ -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")]