From 7181a9824cb7bda6e10f83f0a4d11e3fd493dcbf Mon Sep 17 00:00:00 2001 From: James Ravenscroft Date: Thu, 25 Dec 2014 16:54:29 +0000 Subject: Fixed casting of function pointers --- src/server.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/server.rs') 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)) } } -- cgit v1.2.3 From 26a8e0c20cc1a300f8d03e152c9910839ce1cd53 Mon Sep 17 00:00:00 2001 From: James Ravenscroft Date: Fri, 26 Dec 2014 13:28:56 +0000 Subject: Put examples back to how they were before and removed some into_string deprecated calls --- src/server.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/server.rs') diff --git a/src/server.rs b/src/server.rs index 7504658..309ecfb 100644 --- a/src/server.rs +++ b/src/server.rs @@ -7,6 +7,8 @@ use std::io::{ use std::sync::Arc; use std::sync::Mutex; +use std::borrow::ToOwned; + use callback::Callback; use event; use event::Event; @@ -126,8 +128,8 @@ impl Server { let cmd = parts.remove(0).unwrap(); let event = Event { - prefix: prefix.into_string(), - command: cmd.into_string(), + prefix: prefix.to_owned(), + command: cmd.to_owned(), content: parts.iter().map(|p| p.into_string()).collect() }; -- cgit v1.2.3 From 2ebcb68cd4c88891f42da1e5c1c29fefea947f23 Mon Sep 17 00:00:00 2001 From: James Ravenscroft Date: Fri, 26 Dec 2014 13:47:21 +0000 Subject: No more warnings about deprecation! --- src/server.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/server.rs') diff --git a/src/server.rs b/src/server.rs index 309ecfb..4c4479a 100644 --- a/src/server.rs +++ b/src/server.rs @@ -130,7 +130,7 @@ impl Server { let event = Event { prefix: prefix.to_owned(), command: cmd.to_owned(), - content: parts.iter().map(|p| p.into_string()).collect() + content: parts.into_iter().map(|s| s.to_owned()).collect() }; self.events.lock().fire(&(self.clone(), event)); -- cgit v1.2.3