diff options
author | Jesse Luehrs <doy@tozt.net> | 2014-09-10 16:02:42 -0400 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2014-09-10 16:02:42 -0400 |
commit | 5bca38d9af67001ea6d406c1a447e7cc80a41e29 (patch) | |
tree | 14b22ddb5029ecf95a2855dd763c68082ca5e210 /examples/client.rs | |
parent | b457ab74c224d65b64cfb46732a5b7b5e9bc554d (diff) | |
download | rust-irc-5bca38d9af67001ea6d406c1a447e7cc80a41e29.tar.gz rust-irc-5bca38d9af67001ea6d406c1a447e7cc80a41e29.zip |
move debug output into the library
Diffstat (limited to 'examples/client.rs')
-rw-r--r-- | examples/client.rs | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/examples/client.rs b/examples/client.rs index c5f31a7..db3b244 100644 --- a/examples/client.rs +++ b/examples/client.rs @@ -1,18 +1,13 @@ extern crate irc; -use std::io; - pub struct ExampleClient; impl irc::ClientCallbacks for ExampleClient { - fn on_any_message (&mut self, _client: &mut irc::Client, m: &irc::Message) -> io::IoResult<()> { - print!("{}", m.to_protocol_string()); - Ok(()) - } } fn main () { - let builder = irc::ClientBuilder::new("doytest", "chat.freenode.net"); + let mut builder = irc::ClientBuilder::new("doytest", "chat.freenode.net"); + builder.set_debug(true); let client = builder.connect(); client.run_loop_with_callbacks(ExampleClient); } |