From fc2edc89afdd23df011548b780b3049520d6ded6 Mon Sep 17 00:00:00 2001 From: Tim Kuehn Date: Thu, 16 Feb 2017 12:07:49 -0800 Subject: [PATCH] Fix README future service examples --- README.md | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 28dc3a3..5a0cacb 100644 --- a/README.md +++ b/README.md @@ -125,12 +125,13 @@ impl FutureService for HelloServer { } fn main() { - let mut core = reactor::Core::new().unwrap(); + let mut reactor = reactor::Core::new().unwrap(); let addr = HelloServer.listen("localhost:10000".first_socket_addr(), - server::Options::from(core.handle())) + &reactor.handle(), + server::Options::default()) .unwrap(); - let options = client::Options::default().handle(core.handle()); - core.run(FutureClient::connect(addr, options) + let options = client::Options::default().handle(reactor.handle()); + reactor.run(FutureClient::connect(addr, options) .map_err(tarpc::Error::from) .and_then(|client| client.hello("Mom".to_string())) .map(|resp| println!("{}", resp))) @@ -201,16 +202,16 @@ fn get_acceptor() -> TlsAcceptor { } fn main() { - let mut core = reactor::Core::new().unwrap(); + let mut reactor = reactor::Core::new().unwrap(); let acceptor = get_acceptor(); let addr = HelloServer.listen("localhost:10000".first_socket_addr(), - server::Options::from(core.handle()) - .tls(acceptor)) + &reactor.handle(), + server::Options::default().tls(acceptor)) .unwrap(); let options = client::Options::default() - .handle(core.handle()) + .handle(reactor.handle()) .tls(client::tls::Context::new("foobar.com").unwrap())); - core.run(FutureClient::connect(addr, options) + reactor.run(FutureClient::connect(addr, options) .map_err(tarpc::Error::from) .and_then(|client| client.hello("Mom".to_string())) .map(|resp| println!("{}", resp)))