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();
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"]) {