mirror of
https://github.com/chatmail/core.git
synced 2026-04-06 15:42:10 +03:00
CString::yolo was still used in the ffi, this was an unsafe transitional thing. To remove it there were two choices: 1. make errors in creating CStrings hard errors or 2. try and be as lenient as possible. Given the to_string_lossy() convention adopted in the ffi this choose the lenient option and simply skips over embedded null bytes, leaving the rest of the strings intact. Thus now CString::new_lossy(). It's only used for .strdup() however so no longer a public trait. This also cleans up the public visibility of things in the strings.rs file: - Rename StrExt/OptStrExt traits to what they actually do: provide .strdup() -> Strdup/OptStrdup. - dc_strdup() should be an implementation detail, replace all usages with Strdup.strdup() method. - Only allow visibility inside the crate for all things. - Reduce visibility to only the module for things not used in lib.rs.