feat: implement Display for Milestone

This commit is contained in:
RobWalt 2023-10-21 21:45:16 +02:00
parent ff9c410c44
commit 03a8470acb
No known key found for this signature in database
GPG key ID: 333C6AC0CEF0CE68
2 changed files with 9 additions and 1 deletions

View file

@ -1,6 +1,6 @@
[package]
name = "forgejo-api-types"
version = "0.1.6"
version = "0.1.7"
edition = "2021"
license = "AGPL-3.0-or-later"
keywords = ["forgejo", "types", "codeberg", "api"]

View file

@ -16,6 +16,8 @@
// updated_at string($date-time)
// }
use std::fmt::Display;
use chrono::{DateTime, Utc};
use serde::{Deserialize, Serialize};
@ -46,6 +48,12 @@ pub struct Milestone {
pub updated_at: DateTime<Utc>,
}
impl Display for Milestone {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "{}", self.title)
}
}
#[test]
fn test_milestone_serialization_deserialization() {
use std::str::FromStr;