From: Matt Corallo Date: Sat, 17 Jul 2021 17:39:44 +0000 (+0000) Subject: Correct args passed to supertrait C methods in subtrait impls X-Git-Tag: v0.0.99.3~4^2~9 X-Git-Url: http://git.bitcoin.ninja/?a=commitdiff_plain;h=e5bc76faef879b3fc059263e445b03e6a9435bb9;p=ldk-c-bindings Correct args passed to supertrait C methods in subtrait impls --- diff --git a/c-bindings-gen/src/main.rs b/c-bindings-gen/src/main.rs index 9693e3d..b08f234 100644 --- a/c-bindings-gen/src/main.rs +++ b/c-bindings-gen/src/main.rs @@ -427,7 +427,9 @@ fn writeln_trait<'a, 'b, W: std::io::Write>(w: &mut W, t: &'a syn::ItemTrait, ty } write_method_var_decl_body(w, &m.sig, "\t", $type_resolver, Some(&meth_gen_types), true); write!(w, "(self{}.{})(", $impl_accessor, m.sig.ident).unwrap(); - write_method_call_params(w, &m.sig, "\t", $type_resolver, Some(&meth_gen_types), "", true); + let mut args = Vec::new(); + write_method_call_params(&mut args, &m.sig, "\t", $type_resolver, Some(&meth_gen_types), "", true); + w.write_all(String::from_utf8(args).unwrap().replace("self", &format!("self{}", $impl_accessor)).as_bytes()).unwrap(); writeln!(w, "\n\t}}").unwrap(); },