summaryrefslogtreecommitdiffstats
path: root/examples/tinydb.rs
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2017-12-12 18:32:50 -0600
committerCarl Lerche <me@carllerche.com>2017-12-12 18:32:50 -0600
commit4ef772b2db9fdf19625e428f1031409994b4c8e6 (patch)
tree35d3bd529eedbab426130edde1c9dbc71ff5d80f /examples/tinydb.rs
parent849771ecfa1e22fdd4f0bd299d10f0026ce14ed5 (diff)
Remove `Handle` argument from I/O constructors (#61)
This commit removes the `Handle` argument from the following constructors * `TcpListener::bind` * `TcpStream::connect` * `UdpSocket::bind` The `Handle` argument remains on the various `*_std` constructors as they're more low-level, but this otherwise is intended to set forth a precedent of by default not taking `Handle` arguments and instead relying on the global `Handle::default` return value when necesary.
Diffstat (limited to 'examples/tinydb.rs')
-rw-r--r--examples/tinydb.rs4
1 files changed, 1 insertions, 3 deletions
diff --git a/examples/tinydb.rs b/examples/tinydb.rs
index 7b5c47d1..19a7396d 100644
--- a/examples/tinydb.rs
+++ b/examples/tinydb.rs
@@ -54,7 +54,6 @@ use futures::prelude::*;
use futures::future::Executor;
use futures_cpupool::CpuPool;
use tokio::net::TcpListener;
-use tokio::reactor::Handle;
use tokio_io::AsyncRead;
use tokio_io::io::{lines, write_all};
@@ -84,8 +83,7 @@ fn main() {
// and set up our TCP listener to accept connections.
let addr = env::args().nth(1).unwrap_or("127.0.0.1:8080".to_string());
let addr = addr.parse::<SocketAddr>().unwrap();
- let handle = Handle::default();
- let listener = TcpListener::bind(&addr, &handle).expect("failed to bind");
+ let listener = TcpListener::bind(&addr).expect("failed to bind");
println!("Listening on: {}", addr);
// Create a CpuPool to execute tasks