Fixed cannot #[Union] on enum named From #264

This commit is contained in:
Sunli 2020-09-17 13:20:54 +08:00
parent 34eaa1d686
commit 36b16217d4
2 changed files with 2 additions and 2 deletions

View File

@ -77,7 +77,7 @@ pub fn generate(interface_args: &args::Interface, input: &DeriveInput) -> Result
type_into_impls.push(quote! {
#[allow(clippy::all, clippy::pedantic)]
impl #generics From<#p> for #ident #generics {
impl #generics std::convert::From<#p> for #ident #generics {
fn from(obj: #p) -> Self {
#ident::#enum_name(obj)
}

View File

@ -70,7 +70,7 @@ pub fn generate(union_args: &args::Interface, input: &DeriveInput) -> Result<Tok
enum_names.push(enum_name);
type_into_impls.push(quote! {
#[allow(clippy::all, clippy::pedantic)]
impl #generics From<#p> for #ident #generics {
impl #generics ::std::convert::From<#p> for #ident #generics {
fn from(obj: #p) -> Self {
#ident::#enum_name(obj)
}