Skip to content

Commit

Permalink
Don't use double ref vars in Debug derive
Browse files Browse the repository at this point in the history
  • Loading branch information
JelteF committed Jul 3, 2024
1 parent 55b9bb1 commit bd07a4d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions impl/src/fmt/debug.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ fn expand_struct(
.ident
.clone()
.map_or_else(|| syn::Member::Unnamed(i.into()), syn::Member::Named);
quote! { let #var = &&self.#member; }
quote! { let #var = &self.#member; }
});

let body = quote! {
Expand Down Expand Up @@ -275,7 +275,7 @@ impl<'a> Expansion<'a> {
None => {
let ident = format_ident!("_{i}");
Ok(quote! {
derive_more::__private::DebugTuple::field(#out, #ident)
derive_more::__private::DebugTuple::field(#out, &#ident)
})
}
},
Expand Down Expand Up @@ -316,7 +316,7 @@ impl<'a> Expansion<'a> {
)
}),
None => Ok(quote! {
derive_more::core::fmt::DebugStruct::field(#out, #field_str, #field_ident)
derive_more::core::fmt::DebugStruct::field(#out, #field_str, &#field_ident)
}),
}
})?;
Expand Down

0 comments on commit bd07a4d

Please sign in to comment.