diff options
-rw-r--r-- | examples/01.rs | 4 | ||||
-rw-r--r-- | src/server.rs | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/examples/01.rs b/examples/01.rs index 9756119..ec35e5d 100644 --- a/examples/01.rs +++ b/examples/01.rs @@ -24,14 +24,14 @@ fn callback(arg: (Server, Event)) { fn main() { let mut s = Server::new(); - s.connect("irc.freenode.org".into_string(), 6667).unwrap(); + s.connect("irc.aberwiki.org".into_string(), 6667).unwrap(); s.nick(NAME).unwrap(); s.user(NAME, "*", "*", DESC).unwrap(); s.join("#botzoo").unwrap(); s.msg("flan3002", "Hey, I'm your example bot!").unwrap(); - s.events.lock().register(&callback); + s.events.lock().register(&(callback as fn((Server,Event)))); // Dedicate this thread to listening and event processing s.listen().unwrap(); diff --git a/src/server.rs b/src/server.rs index 343cdee..7504658 100644 --- a/src/server.rs +++ b/src/server.rs @@ -30,7 +30,7 @@ impl Server { stream: Arc::new(Mutex::new(None)), events: { let mut c = Callback::new(); - c.register(&Server::handle_event); + c.register(&(Server::handle_event as fn((Server,Event)))); Arc::new(Mutex::new(c)) } } |