From 2d401b7685e6f142c5945075ba2d79abfa781f49 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Sat, 6 Sep 2014 17:51:16 -0400 Subject: add a basic runloop --- examples/client.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'examples') diff --git a/examples/client.rs b/examples/client.rs index 98900ef..f1f2479 100644 --- a/examples/client.rs +++ b/examples/client.rs @@ -2,9 +2,7 @@ extern crate irc; fn main () { let mut client = irc::ClientBuilder::new("doytest", "chat.freenode.net").connect(); - - loop { - let res = client.read(); - println!("{}", res); - } + client.run_loop_with(|m| { + println!("{}", m); + }); } -- cgit v1.2.3-54-g00ecf