mirror of
https://github.com/chatmail/core.git
synced 2026-05-23 00:36:32 +03:00
run cargo fmt
This commit is contained in:
@@ -378,7 +378,7 @@ unsafe fn new_data_part(
|
|||||||
default_content_type: *mut libc::c_char,
|
default_content_type: *mut libc::c_char,
|
||||||
default_encoding: libc::c_int,
|
default_encoding: libc::c_int,
|
||||||
) -> *mut mailmime {
|
) -> *mut mailmime {
|
||||||
let mut ok_to_continue = true;
|
let mut ok_to_continue = true;
|
||||||
//char basename_buf[PATH_MAX];
|
//char basename_buf[PATH_MAX];
|
||||||
let mut encoding: *mut mailmime_mechanism;
|
let mut encoding: *mut mailmime_mechanism;
|
||||||
let content: *mut mailmime_content;
|
let content: *mut mailmime_content;
|
||||||
@@ -398,7 +398,7 @@ unsafe fn new_data_part(
|
|||||||
}
|
}
|
||||||
content = mailmime_content_new_with_str(content_type_str);
|
content = mailmime_content_new_with_str(content_type_str);
|
||||||
if content.is_null() {
|
if content.is_null() {
|
||||||
ok_to_continue = false;
|
ok_to_continue = false;
|
||||||
} else {
|
} else {
|
||||||
do_encoding = 1i32;
|
do_encoding = 1i32;
|
||||||
if (*(*content).ct_type).tp_type == MAILMIME_TYPE_COMPOSITE_TYPE as libc::c_int {
|
if (*(*content).ct_type).tp_type == MAILMIME_TYPE_COMPOSITE_TYPE as libc::c_int {
|
||||||
@@ -426,44 +426,44 @@ unsafe fn new_data_part(
|
|||||||
}
|
}
|
||||||
encoding = mailmime_mechanism_new(encoding_type, 0 as *mut libc::c_char);
|
encoding = mailmime_mechanism_new(encoding_type, 0 as *mut libc::c_char);
|
||||||
if encoding.is_null() {
|
if encoding.is_null() {
|
||||||
ok_to_continue = false;
|
ok_to_continue = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ok_to_continue {
|
if ok_to_continue {
|
||||||
mime_fields = mailmime_fields_new_with_data(
|
mime_fields = mailmime_fields_new_with_data(
|
||||||
encoding,
|
encoding,
|
||||||
0 as *mut libc::c_char,
|
0 as *mut libc::c_char,
|
||||||
0 as *mut libc::c_char,
|
0 as *mut libc::c_char,
|
||||||
0 as *mut mailmime_disposition,
|
0 as *mut mailmime_disposition,
|
||||||
0 as *mut mailmime_language,
|
0 as *mut mailmime_language,
|
||||||
);
|
);
|
||||||
if mime_fields.is_null() {
|
if mime_fields.is_null() {
|
||||||
ok_to_continue = false;
|
ok_to_continue = false;
|
||||||
|
} else {
|
||||||
|
mime = mailmime_new_empty(content, mime_fields);
|
||||||
|
if mime.is_null() {
|
||||||
|
mailmime_fields_free(mime_fields);
|
||||||
|
mailmime_content_free(content);
|
||||||
} else {
|
} else {
|
||||||
mime = mailmime_new_empty(content, mime_fields);
|
if !data.is_null()
|
||||||
if mime.is_null() {
|
&& data_bytes > 0
|
||||||
mailmime_fields_free(mime_fields);
|
&& (*mime).mm_type == MAILMIME_SINGLE as libc::c_int
|
||||||
mailmime_content_free(content);
|
{
|
||||||
} else {
|
mailmime_set_body_text(mime, data as *mut libc::c_char, data_bytes);
|
||||||
if !data.is_null()
|
|
||||||
&& data_bytes > 0
|
|
||||||
&& (*mime).mm_type == MAILMIME_SINGLE as libc::c_int
|
|
||||||
{
|
|
||||||
mailmime_set_body_text(mime, data as *mut libc::c_char, data_bytes);
|
|
||||||
}
|
|
||||||
return mime;
|
|
||||||
}
|
}
|
||||||
|
return mime;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ok_to_continue == false {
|
if ok_to_continue == false {
|
||||||
if !encoding.is_null() {
|
if !encoding.is_null() {
|
||||||
mailmime_mechanism_free(encoding);
|
mailmime_mechanism_free(encoding);
|
||||||
}
|
}
|
||||||
if !content.is_null() {
|
if !content.is_null() {
|
||||||
mailmime_content_free(content);
|
mailmime_content_free(content);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 0 as *mut mailmime;
|
return 0 as *mut mailmime;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user