feat: implement Display for Milestone
This commit is contained in:
parent
ff9c410c44
commit
03a8470acb
2 changed files with 9 additions and 1 deletions
|
@ -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"]
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue