address three comments from @dignifiedquire

This commit is contained in:
holger krekel
2019-09-22 22:06:25 +02:00
parent 74d8368525
commit ed7cf218f8
2 changed files with 5 additions and 3 deletions

View File

@@ -909,7 +909,7 @@ unsafe fn import_self_keys(context: &Context, dir_name: *const libc::c_char) ->
}
}
set_default = 1;
if name_f.find("legacy").is_some() {
if name_f.contains("legacy") {
info!(
context,
"Treating \"{}\" as a legacy private key.",

View File

@@ -788,8 +788,10 @@ fn build_body_text(text: &str) -> *mut mailmime {
}
fn set_body_text(part: *mut mailmime, text: &str) {
use libc::strlen;
unsafe {
mailmime_set_body_text(part, text.strdup(), text.len());
let text_c = text.strdup();
mailmime_set_body_text(part, text_c, strlen(text_c));
}
}
@@ -909,7 +911,7 @@ fn build_body_file(context: &Context, msg: &Message, base_name: &str) -> (*mut m
pub(crate) fn vec_contains_lowercase(vec: &Vec<String>, part: &str) -> bool {
let partlc = part.to_lowercase();
for cur in vec.iter() {
if (*cur).to_lowercase() == partlc {
if cur.to_lowercase() == partlc {
return true;
}
}