identifiers: Implement From<&Id> for String

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

View File

@ -113,6 +113,12 @@ pub fn expand_id_zst(input: ItemStruct) -> syn::Result<TokenStream> {
} }
} }
impl From<&#id> for String {
fn from(id: &#id) -> Self {
id.as_str().to_owned()
}
}
impl From<Box<#id>> for String { impl From<Box<#id>> for String {
fn from(id: Box<#id>) -> Self { fn from(id: Box<#id>) -> Self {
id.into_owned().into() id.into_owned().into()