From 41ff1965fa4270a3839b35cb3a39165d23e328aa Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Tue, 9 Sep 2014 17:46:27 -0400 Subject: handle errors a bit more properly here --- src/message.rs | 4 ++-- 1 file 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 { -- cgit v1.2.3-54-g00ecf