Simplified some matches to let statements.

This commit is contained in:
Aaron Weiss 2014-09-11 01:14:44 -04:00
parent 9b6919d0bc
commit 1833a0199c

View file

@ -12,13 +12,10 @@ pub fn connect(host: &str, port: u16) -> IoResult<Connection> {
} }
fn send_internal(conn: &Connection, msg: &str) -> IoResult<()> { fn send_internal(conn: &Connection, msg: &str) -> IoResult<()> {
match conn { let &Connection(ref tcp) = conn;
&Connection(ref tcp) => {
let mut writer = BufferedWriter::new(tcp.clone()); let mut writer = BufferedWriter::new(tcp.clone());
writer.write_str(msg); writer.write_str(msg);
writer.flush() writer.flush()
},
}
} }
pub struct Message<'a> { pub struct Message<'a> {