Use Message struct in write_to_test_path()
Signed-off-by: Jacob Kiers <jacob@jacobkiers.net>
This commit is contained in:
parent
02be91a75d
commit
96a9c27fc0
|
@ -103,15 +103,18 @@ fn process_html(input: &str) -> Result<String, sanitize_html::errors::SanitizeEr
|
|||
//Ok(input.to_owned())
|
||||
}
|
||||
|
||||
fn write_to_test_path(uid: &str, message: &[u8]) {
|
||||
let test_path: PathBuf = [Path::new("tests/data"), Path::new(&format!("{}.eml", &uid))]
|
||||
.iter()
|
||||
.collect();
|
||||
fn write_to_test_path(msg: &Message) {
|
||||
let test_path: PathBuf = [
|
||||
Path::new("tests/data"),
|
||||
Path::new(&format!("{}.eml", &msg.get_uid())),
|
||||
]
|
||||
.iter()
|
||||
.collect();
|
||||
|
||||
let _ = OpenOptions::new()
|
||||
.write(true)
|
||||
.create(true)
|
||||
.open(test_path)
|
||||
.expect("Could not open file fir writing")
|
||||
.write_all(&message);
|
||||
.write_all(&msg.data);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue