diff options
author | Manos Pitsidianakis <el13635@mail.ntua.gr> | 2017-09-14 18:29:23 +0300 |
---|---|---|
committer | Manos Pitsidianakis <el13635@mail.ntua.gr> | 2019-06-10 19:14:20 +0300 |
commit | a07f92a8a4285b0c3a8ba1b17d63da44fce55c5e (patch) | |
tree | 6402b21f2295b306c4203d01b8eb6398317b0158 /benches | |
parent | 4119a4285d11f9a8552d554756a0b85c2fac6c35 (diff) |
don't parse mail body until it's requested
Signed-off-by: Manos Pitsidianakis <el13635@mail.ntua.gr>
Diffstat (limited to 'benches')
-rw-r--r-- | benches/parse.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/benches/parse.rs b/benches/parse.rs index 35259a7a..96448114 100644 --- a/benches/parse.rs +++ b/benches/parse.rs @@ -2,11 +2,14 @@ extern crate melib; use melib::mailbox::email::Mail; +use melib::mailbox::backends::BackendOpGenerator; +use melib::mailbox::backends::maildir::MaildirOp; extern crate test; use self::test::Bencher; #[bench] fn mail_parse(b: &mut Bencher) { - b.iter(|| Mail::from("test/attachment_test") ); + b.iter(|| Mail::from(Box::new(BackendOpGenerator::new(Box::new(move || { + Box::new(MaildirOp::new("test/attachment_test".to_string()))})))) ); } |