From 21cd454337357652dc354c012a6a6ddd2b711aa5 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Thu, 29 Apr 2021 22:49:40 +0000 Subject: [PATCH] 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. --- c-bindings-gen/src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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!(), } -- 2.39.5