Skip to content

Commit

Permalink
Fixed the fmt conflict caused by using use std::fmt::Debug (Peter…
Browse files Browse the repository at this point in the history
  • Loading branch information
disoul authored and mich181189 committed Jan 17, 2024
1 parent 3d02957 commit 71786c2
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 @@ -35,7 +35,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 @@ -45,7 +45,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 71786c2

Please sign in to comment.