Use smtp-sink for benchmarks

This commit is contained in:
Alexis Mousset
2015-10-22 23:37:04 +02:00
parent 31a7504d54
commit 2884da8f90
2 changed files with 3 additions and 2 deletions

View File

@@ -11,7 +11,7 @@ use lettre::email::EmailBuilder;
#[bench]
fn bench_simple_send(b: &mut test::Bencher) {
b.iter(|| {
let sender = SmtpTransportBuilder::localhost().unwrap().build();
let sender = SmtpTransportBuilder::new("127.0.0.1:2525").unwrap().build();
let mut mailer = Mailer::new(sender);
let email = EmailBuilder::new()
.to("root@localhost")
@@ -28,7 +28,7 @@ fn bench_simple_send(b: &mut test::Bencher) {
#[bench]
fn bench_reuse_send(b: &mut test::Bencher) {
let sender = SmtpTransportBuilder::localhost().unwrap().connection_reuse(true).build();
let sender = SmtpTransportBuilder::new("127.0.0.1:2525").unwrap().connection_reuse(true).build();
let mut mailer = Mailer::new(sender);
b.iter(|| {
let email = EmailBuilder::new()