identifiers: Add Display implementation for owned types

This commit is contained in:
Jonas Platte 2022-04-14 11:37:07 +02:00
parent ed92a4fbd7
commit d36157a57c
No known key found for this signature in database
GPG Key ID: BBA95679259D342F

View File

@ -265,6 +265,12 @@ fn expand_owned_id(id: &Ident, owned: &Ident) -> TokenStream {
} }
} }
impl std::fmt::Display for #owned {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "{}", self.as_str())
}
}
impl serde::Serialize for #owned { impl serde::Serialize for #owned {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where where