]> git.bitcoin.ninja Git - rust-lightning/commitdiff
[bindings] Ensure owned objects in Vec conversion are marked `mut`
authorMatt Corallo <git@bluematt.me>
Fri, 19 Feb 2021 18:59:13 +0000 (13:59 -0500)
committerMatt Corallo <git@bluematt.me>
Fri, 19 Feb 2021 19:00:41 +0000 (14:00 -0500)
c-bindings-gen/src/types.rs

index 2b195e2dcb957d630bf4478e3204fc5d76a895c5..f7d1e7fa693b5e97605c412741c7dd099aedbf80 100644 (file)
@@ -963,7 +963,7 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> {
                                                ").into() }"))
                        },
                        "Vec" if !is_ref => {
-                               Some(("Vec::new(); for item in ", vec![(format!(".drain(..) {{ local_{}.push(", var_name), "item".to_string())], "); }"))
+                               Some(("Vec::new(); for mut item in ", vec![(format!(".drain(..) {{ local_{}.push(", var_name), "item".to_string())], "); }"))
                        },
                        "Slice" => {
                                Some(("Vec::new(); for item in ", vec![(format!(".iter() {{ local_{}.push(", var_name), "**item".to_string())], "); }"))