From: Matt Corallo Date: Sat, 24 Dec 2022 22:57:17 +0000 (+0000) Subject: Use `Clone::clone(a)` rather than `a.clone` to avoid deref recursion X-Git-Tag: v0.0.113.0^2~10 X-Git-Url: http://git.bitcoin.ninja/?a=commitdiff_plain;h=077c4d770eaa919ed9f4aef56375abe9ef50e55a;p=ldk-c-bindings Use `Clone::clone(a)` rather than `a.clone` to avoid deref recursion --- diff --git a/c-bindings-gen/src/main.rs b/c-bindings-gen/src/main.rs index 02aa72f..0e9a422 100644 --- a/c-bindings-gen/src/main.rs +++ b/c-bindings-gen/src/main.rs @@ -1779,7 +1779,7 @@ fn writeln_enum<'a, 'b, W: std::io::Write>(w: &mut W, e: &'a syn::ItemEnum, type }; if $ref || new_var { if $ref { - write!(w, "let mut {}_nonref = (*{}).clone();\n\t\t\t\t", $field_ident, $field_ident).unwrap(); + write!(w, "let mut {}_nonref = Clone::clone({});\n\t\t\t\t", $field_ident, $field_ident).unwrap(); if new_var { let nonref_ident = format_ident!("{}_nonref", $field_ident); if $to_c {