+ ret_conv = (ty_info.rust_obj + "* ret = MALLOC(sizeof(" + ty_info.rust_obj + "), \"" + ty_info.rust_obj + "\");\n*ret = ", ";")
+ if holds_ref:
+ if (ty_info.rust_obj.replace("LDK", "") + "_clone") in self.clone_fns:
+ ret_conv = (ret_conv[0] + ty_info.rust_obj.replace("LDK", "") + "_clone(&", ");")
+ else:
+ ret_conv = (ret_conv[0], "; // XXX: We likely need to clone here, but no _clone fn is available!")