Simplified some matches to let statements.
This commit is contained in:
parent
9b6919d0bc
commit
1833a0199c
1 changed files with 4 additions and 7 deletions
11
src/lib.rs
11
src/lib.rs
|
@ -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> {
|
||||||
|
|
Loading…
Reference in a new issue