From: Matt Corallo Date: Thu, 29 Apr 2021 22:49:40 +0000 (+0000) Subject: Take parameters to trait functions as mut X-Git-Tag: v0.0.98~9^2~7 X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=21cd454337357652dc354c012a6a6ddd2b711aa5;hp=9069bc0ea8b7fdaa9ee276d78fb0610157edbcf2;p=ldk-c-bindings Take parameters to trait functions as mut In keeping with "generally, make all variables mut so that converters can assume inputs are mut", we should do the same for trait implementation blocks. --- diff --git a/c-bindings-gen/src/main.rs b/c-bindings-gen/src/main.rs index 918a05a..fe3746c 100644 --- a/c-bindings-gen/src/main.rs +++ b/c-bindings-gen/src/main.rs @@ -388,7 +388,7 @@ fn writeln_trait<'a, 'b, W: std::io::Write>(w: &mut W, t: &'a syn::ItemTrait, ty ident.mutability.is_some() || ident.subpat.is_some() { unimplemented!(); } - write!(w, ", {}{}: ", if $type_resolver.skip_arg(&*arg.ty, Some(&meth_gen_types)) { "_" } else { "" }, ident.ident).unwrap(); + write!(w, ", mut {}{}: ", if $type_resolver.skip_arg(&*arg.ty, Some(&meth_gen_types)) { "_" } else { "" }, ident.ident).unwrap(); } _ => unimplemented!(), }