summaryrefslogtreecommitdiffstats
path: root/examples/hello_world.rs
diff options
context:
space:
mode:
Diffstat (limited to 'examples/hello_world.rs')
-rw-r--r--examples/hello_world.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/examples/hello_world.rs b/examples/hello_world.rs
index c94ec53c..a05a8f22 100644
--- a/examples/hello_world.rs
+++ b/examples/hello_world.rs
@@ -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(())
}