summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2014-09-09 17:41:24 -0400
committerJesse Luehrs <doy@tozt.net>2014-09-09 17:41:24 -0400
commit50058305a9505e18678292e9f4b9b1dc17cd3949 (patch)
tree9af37a0a2c8812cd4d4270036cf4575448a964cf /examples
parent0ed3107270494e6c780066a22f532941869e19f2 (diff)
downloadrust-irc-50058305a9505e18678292e9f4b9b1dc17cd3949.tar.gz
rust-irc-50058305a9505e18678292e9f4b9b1dc17cd3949.zip
propagate a few more errors
Diffstat (limited to 'examples')
-rw-r--r--examples/client.rs9
1 files changed, 6 insertions, 3 deletions
diff --git a/examples/client.rs b/examples/client.rs
index 5b874bb..0794329 100644
--- a/examples/client.rs
+++ b/examples/client.rs
@@ -2,19 +2,22 @@ extern crate irc;
use irc::constants::Pong;
+use std::io;
+
pub struct ExampleClient;
impl irc::ClientCallbacks for ExampleClient {
- fn on_any_message (&mut self, _client: &mut irc::Client, m: &irc::Message) {
+ fn on_any_message (&mut self, _client: &mut irc::Client, m: &irc::Message) -> io::IoResult<()> {
print!("{}", m.to_protocol_string());
+ Ok(())
}
- fn on_ping (&mut self, client: &mut irc::Client, _from: Option<&str>, server1: &str, server2: Option<&str>) {
+ fn on_ping (&mut self, client: &mut irc::Client, _from: Option<&str>, server1: &str, server2: Option<&str>) -> io::IoResult<()> {
let params = match server2 {
Some(server2) => vec![server1.to_string(), server2.to_string()],
None => vec![server1.to_string()],
};
- client.write(irc::Message::new(None, Pong, params));
+ client.write(irc::Message::new(None, Pong, params))
}
}