+ needs_full_clone = not is_free and (not ty_info.is_ptr and not holds_ref or ty_info.requires_clone == True) and ty_info.requires_clone != False
+ if needs_full_clone:
+ if not ty_info.var_name.startswith("ret") or "res" in ty_info.var_name: # XXX: This is a stupid hack
+ needs_full_clone = False
+ 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.rust_obj + "*)" + ty_info.var_name + ");"
+ elif needs_full_clone:
+ base_conv = base_conv + "\n// Warning: we may need a move here but can't do a full clone!"
+ if not needs_full_clone and ty_info.rust_obj != "LDKu8slice":