diff --git a/crates/ruma-macros/src/identifiers.rs b/crates/ruma-macros/src/identifiers.rs index 9dddc616..7428d4ed 100644 --- a/crates/ruma-macros/src/identifiers.rs +++ b/crates/ruma-macros/src/identifiers.rs @@ -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> for #owned_ty { fn from(b: Box<#id_ty>) -> #owned_ty {