diff options
author | Jesse Luehrs <doy@tozt.net> | 2014-09-02 13:01:05 -0400 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2014-09-02 13:01:05 -0400 |
commit | af74512d17c287f5435d70c32aa4ce1618156fb7 (patch) | |
tree | ccfe10f3e4f4a6de2bb7ee1c6359f8f5d588508b | |
parent | 78aa2bc558e9f568179bee0a067c0f20125e6f25 (diff) | |
download | rusty-irc-af74512d17c287f5435d70c32aa4ce1618156fb7.tar.gz rusty-irc-af74512d17c287f5435d70c32aa4ce1618156fb7.zip |
-rw-r--r-- | src/lib.rs | 1 | ||||
-rw-r--r-- | src/msg.rs | 10 |
2 files changed, 5 insertions, 6 deletions
@@ -1,4 +1,3 @@ -#![crate_id = "irc#0.1"] #![crate_type = "lib"] use std::io::TcpStream; @@ -164,7 +164,7 @@ impl FromStr for Message { for c in s.chars() { match c { c if is_final => { - current_str.get_mut_ref().push_char(c); + current_str.as_mut().unwrap().push_char(c); } ' ' => { if is_prefix { @@ -174,7 +174,7 @@ impl FromStr for Message { cmd = current_str.take(); } else { - args.push(current_str.take_unwrap()); + args.push(current_str.take().unwrap()); } is_prefix = false; } @@ -191,7 +191,7 @@ impl FromStr for Message { if current_str.is_none() { current_str = Some(String::new()); } - current_str.get_mut_ref().push_char(c) + current_str.as_mut().unwrap().push_char(c) } } } @@ -200,7 +200,7 @@ impl FromStr for Message { cmd = current_str.take(); } else { - args.push(current_str.take_unwrap()); + args.push(current_str.take().unwrap()); } let prefix: Option<Prefix> = prefix.and_then(|s| from_str(s.as_slice())); @@ -234,7 +234,7 @@ impl FromStr for Message { other => { match from_str::<u16>(other) { Some(n) if args.len() > 0 => { - let target = args.shift().unwrap(); + let target = args.remove(0).unwrap(); cmd::Numeric(n, target, args) } _ => cmd::UnknownCmd(s.to_string(), args) |