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())
|
//Ok(input.to_owned())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn write_to_test_path(uid: &str, message: &[u8]) {
|
fn write_to_test_path(msg: &Message) {
|
||||||
let test_path: PathBuf = [Path::new("tests/data"), Path::new(&format!("{}.eml", &uid))]
|
let test_path: PathBuf = [
|
||||||
.iter()
|
Path::new("tests/data"),
|
||||||
.collect();
|
Path::new(&format!("{}.eml", &msg.get_uid())),
|
||||||
|
]
|
||||||
|
.iter()
|
||||||
|
.collect();
|
||||||
|
|
||||||
let _ = OpenOptions::new()
|
let _ = OpenOptions::new()
|
||||||
.write(true)
|
.write(true)
|
||||||
.create(true)
|
.create(true)
|
||||||
.open(test_path)
|
.open(test_path)
|
||||||
.expect("Could not open file fir writing")
|
.expect("Could not open file fir writing")
|
||||||
.write_all(&message);
|
.write_all(&msg.data);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue