Resolve issues with Str introduced when it became ownable
[ldk-c-bindings] / c-bindings-gen / src / main.rs
index 1f17fef9ead0dba1887eedd2134d6e3ce37eaa00..81f26bfa9ee3fce3da20931b431a90cfb91fee4b 100644 (file)
@@ -966,7 +966,7 @@ fn writeln_impl<W: std::io::Write>(w: &mut W, i: &syn::ItemImpl, types: &mut Typ
                                                        writeln!(w, "#[no_mangle]").unwrap();
                                                        writeln!(w, "/// Read a {} object from a string", ident).unwrap();
                                                        writeln!(w, "pub extern \"C\" fn {}_from_str(s: crate::c_types::Str) -> {} {{", ident, container).unwrap();
-                                                       writeln!(w, "\tmatch {}::from_str(s.into()) {{", resolved_path).unwrap();
+                                                       writeln!(w, "\tmatch {}::from_str(s.into_str()) {{", resolved_path).unwrap();
                                                        writeln!(w, "\t\tOk(r) => {{").unwrap();
                                                        let new_var = types.write_to_c_conversion_new_var(w, &format_ident!("r"), &*i.self_ty, Some(&gen_types), false);
                                                        write!(w, "\t\t\tcrate::c_types::CResultTempl::ok(\n\t\t\t\t").unwrap();
@@ -974,7 +974,7 @@ fn writeln_impl<W: std::io::Write>(w: &mut W, i: &syn::ItemImpl, types: &mut Typ
                                                        write!(w, "{}r", if new_var { "local_" } else { "" }).unwrap();
                                                        types.write_to_c_conversion_inline_suffix(w, &*i.self_ty, Some(&gen_types), false);
                                                        writeln!(w, "\n\t\t\t)\n\t\t}},").unwrap();
-                                                       writeln!(w, "\t\tErr(e) => crate::c_types::CResultTempl::err(0u8),").unwrap();
+                                                       writeln!(w, "\t\tErr(e) => crate::c_types::CResultTempl::err(()),").unwrap();
                                                        writeln!(w, "\t}}.into()\n}}").unwrap();
                                                }
                                        } else if path_matches_nongeneric(&trait_path.1, &["Display"]) {