mirror of
https://github.com/chatmail/core.git
synced 2026-04-28 10:56:29 +03:00
Remove to_cstring() naming convention ambiguity
Add a trait for str.strdup() to replace to_cstring() which avoid the signature ambiguity with .to_string(). Also instruduce CString::yolo() as a shortcut to CString::new().unwrap() and use it whenever the variable does can be deallocated by going out of scope. This is less error prone. Use some Path.to_c_string() functions where possible.
This commit is contained in:
committed by
Floris Bruynooghe
parent
e7428887d0
commit
b6b0849bce
@@ -1312,9 +1312,8 @@ unsafe fn dc_mimeparser_add_single_part_if_known(
|
||||
}
|
||||
if !filename_parts.is_empty() {
|
||||
free(desired_filename as *mut libc::c_void);
|
||||
let parts_c = to_cstring(filename_parts);
|
||||
desired_filename = dc_decode_ext_header(parts_c);
|
||||
free(parts_c as *mut _);
|
||||
let parts_c = CString::yolo(filename_parts);
|
||||
desired_filename = dc_decode_ext_header(parts_c.as_ptr());
|
||||
}
|
||||
if desired_filename.is_null() {
|
||||
let param = mailmime_find_ct_parameter(
|
||||
|
||||
Reference in New Issue
Block a user