Fixed bug with Message parsing causing suffixes to include colon prefix.

This commit is contained in:
Aaron Weiss 2014-11-03 02:42:06 -05:00
parent c8dc582fd1
commit 4479c59e79
2 changed files with 2 additions and 2 deletions

View file

@ -21,6 +21,6 @@ fn main() {
let server = IrcServer::from_config(config).unwrap(); let server = IrcServer::from_config(config).unwrap();
identify(&server).unwrap(); identify(&server).unwrap();
for message in server.iter() { for message in server.iter() {
println!("{}", message) println!("{}", message.into_string())
} }
} }

View file

@ -64,7 +64,7 @@ impl FromStr for Message {
None None
}; };
let suffix = if state.contains(":") { let suffix = if state.contains(":") {
let suffix = state.find(':').map(|i| state[i..state.len()-1]); let suffix = state.find(':').map(|i| state[i+1..state.len()-1]);
state = state.find(':').map_or("", |i| state[..i]); state = state.find(':').map_or("", |i| state[..i]);
suffix suffix
} else { } else {