Skip to content

Commit e34e66c

Browse files
authored
Fixed the fmt conflict caused by using use std::fmt::Debug (#322)
1 parent 216e4de commit e34e66c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

strum_macros/src/macros/strings/display.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ pub fn display_inner(ast: &DeriveInput) -> syn::Result<TokenStream> {
3838
if variant_properties.to_string.is_none() && variant_properties.default.is_some() {
3939
match &variant.fields {
4040
Fields::Unnamed(fields) if fields.unnamed.len() == 1 => {
41-
arms.push(quote! { #name::#ident(ref s) => s.fmt(f) });
41+
arms.push(quote! { #name::#ident(ref s) => ::core::fmt::Display::fmt(s, f) });
4242
}
4343
_ => {
4444
return Err(syn::Error::new_spanned(
@@ -48,7 +48,7 @@ pub fn display_inner(ast: &DeriveInput) -> syn::Result<TokenStream> {
4848
}
4949
}
5050
} else {
51-
arms.push(quote! { #name::#ident #params => (#output).fmt(f) } );
51+
arms.push(quote! { #name::#ident #params => ::core::fmt::Display::fmt(#output, f) } );
5252
}
5353
}
5454

0 commit comments

Comments
 (0)