tests: handle errors properly in examples (#748)

This commit is contained in:
Liran Ringel
2018-11-20 11:10:36 -05:00
committed by Toby Lawrence
parent 477fa5580a
commit 9b1a45cc6a
19 changed files with 144 additions and 119 deletions
+3 -2
View File
@@ -14,7 +14,7 @@ use futures::{Future, Stream, Sink};
use std::io;
pub fn main() {
pub fn main() -> Result<(), Box<std::error::Error>> {
let pool = Builder::new()
.pool_size(1)
.build();
@@ -44,5 +44,6 @@ pub fn main() {
.map_err(|e| panic!("io error = {:?}", e))
});
pool.shutdown_on_idle().wait().unwrap();
pool.shutdown_on_idle().wait().map_err(|_| "failed to shutdown the thread pool")?;
Ok(())
}