Updated examples for removal of proc.

This commit is contained in:
Aaron Weiss 2014-12-16 03:22:05 -05:00
parent 76dc3a855f
commit 5a77845691
2 changed files with 2 additions and 2 deletions

View file

@ -20,7 +20,7 @@ fn main() {
server.identify().unwrap(); server.identify().unwrap();
let server = irc_server.clone(); let server = irc_server.clone();
// We won't use a wrapper here because we don't need the added functionality. // We won't use a wrapper here because we don't need the added functionality.
spawn(proc() { spawn(move || {
for msg in server.iter() { for msg in server.iter() {
print!("{}", msg.into_string()); print!("{}", msg.into_string());
} }

View file

@ -22,7 +22,7 @@ fn main() {
let server = Wrapper::new(&*irc_server2); let server = Wrapper::new(&*irc_server2);
server.identify().unwrap(); server.identify().unwrap();
// Let's set up a loop that just prints the messages. // Let's set up a loop that just prints the messages.
spawn(proc() { irc_server.iter().map(|m| print!("{}", m.into_string())).count(); }); spawn(move || { irc_server.iter().map(|m| print!("{}", m.into_string())).count(); });
loop { loop {
server.send_privmsg("#vana", "TWEET TWEET").unwrap(); server.send_privmsg("#vana", "TWEET TWEET").unwrap();
sleep(Duration::seconds(10)) sleep(Duration::seconds(10))