Fix test errors and warnings

This commit is contained in:
Manos Pitsidianakis 2020-11-16 01:04:04 +02:00
parent 023afbaae3
commit a7c0bca8ce
No known key found for this signature in database
GPG Key ID: 73627C2F690DF710
5 changed files with 6 additions and 11 deletions

View File

@ -324,14 +324,12 @@ fn print_attachment(ret: &mut String, a: AttachmentBuilder) {
ret.push_str(line);
ret.push_str("\r\n");
}
ret.push_str("\r\n");
}
Text { .. } => {
for line in a.build().into_raw().lines() {
ret.push_str(line);
ret.push_str("\r\n");
}
ret.push_str("\r\n");
}
Multipart {
boundary: _,
@ -346,7 +344,6 @@ fn print_attachment(ret: &mut String, a: AttachmentBuilder) {
.map(|s| s.into())
.collect::<Vec<AttachmentBuilder>>(),
);
ret.push_str("\r\n");
}
MessageRfc822 => {
ret.push_str(&format!(
@ -359,7 +356,6 @@ fn print_attachment(ret: &mut String, a: AttachmentBuilder) {
ret.push_str(line);
ret.push_str("\r\n");
}
ret.push_str("\r\n");
}
PGPSignature => {
ret.push_str(&format!(
@ -373,7 +369,6 @@ fn print_attachment(ret: &mut String, a: AttachmentBuilder) {
ret.push_str(line);
ret.push_str("\r\n");
}
ret.push_str("\r\n");
}
_ => {
let content_transfer_encoding: ContentTransferEncoding = if a.raw().is_ascii() {
@ -410,7 +405,6 @@ fn print_attachment(ret: &mut String, a: AttachmentBuilder) {
ret.push_str("\r\n");
}
}
ret.push_str("\r\n");
}
}
}

View File

@ -179,7 +179,7 @@ fn test_encode_header() {
)
.unwrap(),
);
let words = "[Advcomparch] =?utf-8?b?zqPPhc68z4DOtc+BzrnPhs6/z4HOrCDPg861IGZs?=\n\t=?utf-8?b?dXNoIM67z4zOs8+JIG1pc3ByZWRpY3Rpb24gzrrOsc+Ezqwgz4TOt869?=\n\t=?utf-8?b?IM61zrrPhM6tzrvOtc+Dzrcgc3RvcmU=?=";
//let words = "[Advcomparch] =?utf-8?b?zqPPhc68z4DOtc+BzrnPhs6/z4HOrCDPg861IGZs?=\n\t=?utf-8?b?dXNoIM67z4zOs8+JIG1pc3ByZWRpY3Rpb24gzrrOsc+Ezqwgz4TOt869?=\n\t=?utf-8?b?IM61zrrPhM6tzrvOtc+Dzrcgc3RvcmU=?=";
let words_enc = "[Advcomparch] Συμπεριφορά σε flush λόγω misprediction κατά την εκτέλεση store";
assert_eq!(
"[Advcomparch] Συμπεριφορά σε flush λόγω misprediction κατά την εκτέλεση store",

View File

@ -1200,8 +1200,8 @@ List-Archive: <http://www.host.com/list/archive/> (Web Archive)
"#;
let (rest, headers) = headers::headers(s.as_bytes()).unwrap();
assert!(rest.is_empty());
for (h, v) in headers {
let (rest, action_list) = rfc_2369_list_headers_action_list(v).unwrap();
for (_h, v) in headers {
let (rest, _action_list) = rfc_2369_list_headers_action_list(v).unwrap();
assert!(rest.is_empty());
}
}
@ -2486,7 +2486,7 @@ pub mod address {
#[cfg(test)]
mod tests {
use super::{address::*, encodings::*, generic::*, *};
use super::{address::*, encodings::*, *};
use crate::email::address::*;
use crate::make_address;

View File

@ -17,6 +17,7 @@ fn main() -> Result<()> {
username: "username".into(),
password: Password::CommandEval("gpg2 --no-tty -q -d ~/.passwords/password.gpg".into()),
require_auth: true,
auth_type: Default::default(),
},
envelope_from: String::new(),
};