Skip to content

Commit

Permalink
Fixed the fmt conflict caused by using use std::fmt::Debug (#322)
Browse files Browse the repository at this point in the history
  • Loading branch information
disoul authored Jan 7, 2024
1 parent 216e4de commit e34e66c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions strum_macros/src/macros/strings/display.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ pub fn display_inner(ast: &DeriveInput) -> syn::Result<TokenStream> {
if variant_properties.to_string.is_none() && variant_properties.default.is_some() {
match &variant.fields {
Fields::Unnamed(fields) if fields.unnamed.len() == 1 => {
arms.push(quote! { #name::#ident(ref s) => s.fmt(f) });
arms.push(quote! { #name::#ident(ref s) => ::core::fmt::Display::fmt(s, f) });
}
_ => {
return Err(syn::Error::new_spanned(
Expand All @@ -48,7 +48,7 @@ pub fn display_inner(ast: &DeriveInput) -> syn::Result<TokenStream> {
}
}
} else {
arms.push(quote! { #name::#ident #params => (#output).fmt(f) } );
arms.push(quote! { #name::#ident #params => ::core::fmt::Display::fmt(#output, f) } );
}
}

Expand Down

0 comments on commit e34e66c

Please sign in to comment.