diff options
author | Jesse Luehrs <doy@tozt.net> | 2014-09-09 17:46:27 -0400 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2014-09-09 17:46:27 -0400 |
commit | 41ff1965fa4270a3839b35cb3a39165d23e328aa (patch) | |
tree | ff71788afe9e9ec36252fd79fc4b1f1d59364e54 | |
parent | 50058305a9505e18678292e9f4b9b1dc17cd3949 (diff) | |
download | rust-irc-41ff1965fa4270a3839b35cb3a39165d23e328aa.tar.gz rust-irc-41ff1965fa4270a3839b35cb3a39165d23e328aa.zip |
handle errors a bit more properly here
-rw-r--r-- | src/message.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/message.rs b/src/message.rs index b7076d5..094720e 100644 --- a/src/message.rs +++ b/src/message.rs @@ -72,8 +72,8 @@ impl Message { let mut w = io::MemWriter::new(); // this should never fail, so unwrap is fine self.write_protocol_string(&mut w).unwrap(); - // XXX error handling, encoding - String::from_utf8(w.unwrap()).unwrap() + // XXX encoding + String::from_utf8_lossy(w.unwrap().as_slice()).into_string() } fn parse_params(params: &str) -> Vec<String> { |