X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=gen_type_mapping.py;h=fe2aed21397c45a2e26b39b2333fd90fdfb83fb7;hb=3c80c9d8174c6a4355b2fc0790288ea46e4631e4;hp=7eda9b7ca01c04f34ecb9792a4224e6d6ce82fc3;hpb=56b390596670c976a82419933a7206eb93cd1484;p=ldk-java diff --git a/gen_type_mapping.py b/gen_type_mapping.py index 7eda9b7c..fe2aed21 100644 --- a/gen_type_mapping.py +++ b/gen_type_mapping.py @@ -275,9 +275,7 @@ class TypeMappingGenerator: if needs_full_clone and (ty_info.rust_obj.replace("LDK", "") + "_clone") in self.clone_fns: base_conv = base_conv + "\n" + ty_info.var_name + "_conv = " + ty_info.rust_obj.replace("LDK", "") + "_clone(" + ty_info.var_name + ");" else: - base_conv = base_conv + "\nif (" + ty_info.var_name + "_conv.free == " + ty_info.rust_obj + "_JCalls_free) {\n" - base_conv = base_conv + "\t// If this_arg is a JCalls struct, then we need to increment the refcnt in it.\n" - base_conv = base_conv + "\t" + ty_info.rust_obj + "_JCalls_clone(" + ty_info.var_name + "_conv.this_arg);\n}" + base_conv = base_conv + self.consts.trait_struct_inc_refcnt(ty_info) if needs_full_clone: base_conv = base_conv + "// Warning: we may need a move here but can't do a full clone!\n"