summaryrefslogtreecommitdiffstats
path: root/examples/manual-runtime.rs
diff options
context:
space:
mode:
authorLiran Ringel <5730310+liranringel@users.noreply.github.com>2018-11-20 18:10:36 +0200
committerToby Lawrence <tobz@users.noreply.github.com>2018-11-20 11:10:36 -0500
commit9b1a45cc6a15f5d2be17531dffc2f50d2b019646 (patch)
treeda66c5c9574f2cd7ad11745e414fc34da2e35c6f /examples/manual-runtime.rs
parent477fa5580aa3796f97e3e0eb1325d4690b3b4e96 (diff)
tests: handle errors properly in examples (#748)
Diffstat (limited to 'examples/manual-runtime.rs')
-rw-r--r--examples/manual-runtime.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/examples/manual-runtime.rs b/examples/manual-runtime.rs
index 6cbb8cd4..8e3e1299 100644
--- a/examples/manual-runtime.rs
+++ b/examples/manual-runtime.rs
@@ -60,7 +60,7 @@ fn run<F: Future<Item = (), Error = ()>>(f: F) -> Result<(), IoError> {
Ok(())
}
-fn main() {
+fn main() -> Result<(), Box<std::error::Error>> {
run(future::lazy(|| {
// Here comes the application logic. It can spawn further tasks by tokio_current_thread::spawn().
// It also can use the default reactor and create timeouts.
@@ -82,5 +82,6 @@ fn main() {
// We can spawn on the default executor, which is also the local one.
tokio::executor::spawn(deadline);
Ok(())
- })).unwrap();
+ }))?;
+ Ok(())
}