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
+4 -2
View File
@@ -19,8 +19,8 @@ use tokio::io;
use tokio::net::TcpStream;
use tokio::prelude::*;
pub fn main() {
let addr = "127.0.0.1:6142".parse().unwrap();
pub fn main() -> Result<(), Box<std::error::Error>> {
let addr = "127.0.0.1:6142".parse()?;
// Open a TCP stream to the socket address.
//
@@ -52,4 +52,6 @@ pub fn main() {
println!("About to create the stream and write to it...");
tokio::run(client);
println!("Stream has been created and written to.");
Ok(())
}