diff --git a/src/identifier.rs b/src/identifier.rs index 9064beb..d21a414 100644 --- a/src/identifier.rs +++ b/src/identifier.rs @@ -1,3 +1,4 @@ +use std::fmt::Display; use std::str::FromStr; use serde::{Deserialize, Serialize}; @@ -30,6 +31,16 @@ impl FromStr for Identifier { } } +impl Display for Identifier { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + let str = match self { + Identifier::Id(id) => id.to_string(), + Identifier::PersistentId(pid) => pid.to_owned(), + }; + write!(f, "{}", str) + } +} + #[cfg(test)] mod tests {