fix: data component try_from_name

This commit is contained in:
Alexander Medvedev
2026-08-08 16:12:56 +02:00
parent ee6e0474ff
commit e5047bd4c9
6 changed files with 74 additions and 13 deletions

View File

@@ -36,7 +36,7 @@ pub fn build() -> TokenStream {
// TODO use phf
name_to_enum.extend(quote! {
#raw_name => Some(Self::#pascal_case),
#raw_name | #strip_name => Some(Self::#pascal_case),
});
// Enum -> &str

View File

@@ -187,7 +187,7 @@ pub fn build() -> TokenStream {
}]);
}
name_to_type.extend(quote! { #name => Some(&Self::#format_name), });
name_to_type.extend(quote! { #name | #raw_name => Some(&Self::#format_name), });
id_to_type.extend(quote! { #id => Some(&Self::#format_name), });
}