mirror of
https://github.com/chatmail/core.git
synced 2026-05-07 17:06:35 +03:00
Avoid separate declaration and definition of `need_drop' variable
This commit is contained in:
committed by
Floris Bruynooghe
parent
f5416b1c2c
commit
47c0526026
@@ -204,19 +204,18 @@ pub unsafe fn dc_mimeparser_parse<'a>(context: &'a Context, body: &[u8]) -> dc_m
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if mimeparser.is_send_by_messenger && mimeparser.parts.len() == 2 {
|
if mimeparser.is_send_by_messenger && mimeparser.parts.len() == 2 {
|
||||||
let need_drop: bool;
|
let need_drop = {
|
||||||
{
|
|
||||||
let textpart = &mimeparser.parts[0];
|
let textpart = &mimeparser.parts[0];
|
||||||
let filepart = &mimeparser.parts[1];
|
let filepart = &mimeparser.parts[1];
|
||||||
need_drop = textpart.type_0 == 10i32
|
textpart.type_0 == 10i32
|
||||||
&& (filepart.type_0 == 20i32
|
&& (filepart.type_0 == 20i32
|
||||||
|| filepart.type_0 == 21i32
|
|| filepart.type_0 == 21i32
|
||||||
|| filepart.type_0 == 40i32
|
|| filepart.type_0 == 40i32
|
||||||
|| filepart.type_0 == 41i32
|
|| filepart.type_0 == 41i32
|
||||||
|| filepart.type_0 == 50i32
|
|| filepart.type_0 == 50i32
|
||||||
|| filepart.type_0 == 60i32)
|
|| filepart.type_0 == 60i32)
|
||||||
&& 0 == filepart.is_meta;
|
&& 0 == filepart.is_meta
|
||||||
}
|
};
|
||||||
|
|
||||||
if need_drop {
|
if need_drop {
|
||||||
let mut filepart = mimeparser.parts.swap_remove(1);
|
let mut filepart = mimeparser.parts.swap_remove(1);
|
||||||
|
|||||||
Reference in New Issue
Block a user