Merge pull request #190 from amousset/fix-benchmark

fix(transport): Update benchmark code
This commit is contained in:
Alexis Mousset
2017-08-21 15:23:39 +02:00
committed by GitHub
2 changed files with 3 additions and 3 deletions

View File

@@ -19,7 +19,7 @@ fn bench_simple_send(b: &mut test::Bencher) {
"id".to_string(),
"Hello world".to_string(),
);
let result = sender.send(email);
let result = sender.send(&email);
assert!(result.is_ok());
});
}
@@ -37,7 +37,7 @@ fn bench_reuse_send(b: &mut test::Bencher) {
"id".to_string(),
"Hello world".to_string(),
);
let result = sender.send(email);
let result = sender.send(&email);
assert!(result.is_ok());
});
sender.close()

View File

@@ -237,7 +237,7 @@ impl<S: Connector + Write + Read + Timeout + Debug> Client<S> {
return Err(From::from("Connection closed"));
}
self.stream.as_mut().unwrap().write(string)?;
self.stream.as_mut().unwrap().write_all(string)?;
self.stream.as_mut().unwrap().flush()?;
debug!(