identifiers: add clone from owned reference

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk 2025-01-22 06:30:05 +00:00
parent c4f55b3990
commit 427877d5bc

View File

@ -413,6 +413,13 @@ fn expand_owned_id(input: &ItemStruct, inline_bytes: usize) -> TokenStream {
}
}
#[automatically_derived]
impl #impl_generics From<&'_ #owned_ty> for #owned_ty {
fn from(id: &#owned_ty) -> #owned_ty {
id.clone()
}
}
#[automatically_derived]
impl #impl_generics From<Box<#id_ty>> for #owned_ty {
fn from(b: Box<#id_ty>) -> #owned_ty {