aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTill Hoeppner2015-04-18 15:12:41 +0200
committerTill Hoeppner2015-04-18 15:12:41 +0200
commit3483b65e9173d9ef7ea709de898b3a7866045fbd (patch)
tree3c51860688f8c963e71d2ff372ec3c343ca466a8
parenta8c80253d6361728db95e6a5640a91a341ad4ea5 (diff)
downloadirsc-3483b65e9173d9ef7ea709de898b3a7866045fbd.tar.gz
irsc-3483b65e9173d9ef7ea709de898b3a7866045fbd.tar.xz
irsc-3483b65e9173d9ef7ea709de898b3a7866045fbd.zip
Make tests/examples compile, not work though
-rw-r--r--examples/01.rs8
-rw-r--r--src/message.rs4
-rw-r--r--src/server.rs6
3 files changed, 7 insertions, 11 deletions
diff --git a/examples/01.rs b/examples/01.rs
index 021fd2f..ee6c99a 100644
--- a/examples/01.rs
+++ b/examples/01.rs
@@ -1,5 +1,4 @@
-#![allow(unstable)]
-#![feature(plugin, slicing_syntax)]
+#![feature(plugin)]
#![plugin(regex_macros)]
extern crate irsc;
@@ -10,7 +9,6 @@ use std::sync::{Once, ONCE_INIT};
use irsc::server::Server;
use irsc::color::bold;
-use irsc::message;
use irsc::message::{ Message, Command };
static NAME: &'static str = "rusticbot";
@@ -30,8 +28,6 @@ fn callback(server: &mut Server, msg: &Message) {
/*
"001" => {
START.call_once(|| {
- server.msg("Nalfon", "Hey, I'm poking you! *pokes you*").unwrap();
- //server.msg("Xasin", "Hey, I'm poking you! *pokes you*").unwrap();
})
},
_ => ()
@@ -40,7 +36,7 @@ fn callback(server: &mut Server, msg: &Message) {
fn main() {
let mut s = Server::new();
- s.connect("irc.furnet.org".to_owned(), 6667).unwrap();
+ s.connect("irc.mozilla.org".to_owned(), 6667).unwrap();
s.nick(NAME).unwrap();
s.user(NAME, "*", "*", DESC).unwrap();
s.join("#botzoo").unwrap();
diff --git a/src/message.rs b/src/message.rs
index dfe7f29..fd77aef 100644
--- a/src/message.rs
+++ b/src/message.rs
@@ -1189,7 +1189,7 @@ mod test {
Some(Cow::Owned("*** Looking up your hostname...".to_owned())),
MsgType::Irc
);
- assert_eq!(a.parse(), Some(a2.clone()));
+ assert_eq!(a.parse::<Message>().unwrap(), a2.clone());
assert_eq!(a2.to_string(), a);
let b = ":d PRIVMSG You :\u{1}ACTION sends you funny pictures of cats!\u{1}";
@@ -1200,7 +1200,7 @@ mod test {
Some(Cow::Owned("\u{1}ACTION sends you funny pictures of cats!\u{1}".to_owned())),
MsgType::Ctcp
);
- assert_eq!(b.parse(), Some(b2.clone()));
+ assert_eq!(b.parse::<Message>().unwrap(), b2.clone());
assert_eq!(b2.to_string(), b);
}
diff --git a/src/server.rs b/src/server.rs
index dfe5051..8f48938 100644
--- a/src/server.rs
+++ b/src/server.rs
@@ -2,7 +2,7 @@ use std::io::{
self,
Write,
Read,
-// BufRead,
+ BufRead,
BufReader,
};
@@ -154,7 +154,7 @@ impl Server {
None => return Err(::IrscError::NotConnected)
});
- /*for line in reader.lines() {
+ for line in reader.lines() {
let line = line.unwrap().parse();
if let Ok(msg) = line {
@@ -164,7 +164,7 @@ impl Server {
e(self, &msg)
}
}
- }*/
+ }
Ok(())
}
}