More style

This commit is contained in:
arkpar 2016-01-08 13:55:44 +01:00
parent 396a1755e3
commit 469b0a17dc

View File

@ -462,7 +462,6 @@ impl Host {
fn connection_writable(&mut self, token: Token, event_loop: &mut EventLoop<Host>) { fn connection_writable(&mut self, token: Token, event_loop: &mut EventLoop<Host>) {
let mut kill = false; let mut kill = false;
let mut create_session = false; let mut create_session = false;
{
match self.connections.get_mut(token) { match self.connections.get_mut(token) {
Some(&mut ConnectionEntry::Handshake(ref mut h)) => { Some(&mut ConnectionEntry::Handshake(ref mut h)) => {
h.writable(event_loop, &self.info).unwrap_or_else(|e| { h.writable(event_loop, &self.info).unwrap_or_else(|e| {
@ -480,7 +479,6 @@ impl Host {
_ => { _ => {
warn!(target: "net", "Received event for unknown connection"); warn!(target: "net", "Received event for unknown connection");
} }
};
} }
if kill { if kill {
self.kill_connection(token, event_loop); self.kill_connection(token, event_loop);
@ -496,7 +494,6 @@ impl Host {
let mut create_session = false; let mut create_session = false;
let mut ready_data: Vec<ProtocolId> = Vec::new(); let mut ready_data: Vec<ProtocolId> = Vec::new();
let mut packet_data: Option<(ProtocolId, PacketId, Vec<u8>)> = None; let mut packet_data: Option<(ProtocolId, PacketId, Vec<u8>)> = None;
{
match self.connections.get_mut(token) { match self.connections.get_mut(token) {
Some(&mut ConnectionEntry::Handshake(ref mut h)) => { Some(&mut ConnectionEntry::Handshake(ref mut h)) => {
h.readable(event_loop, &self.info).unwrap_or_else(|e| { h.readable(event_loop, &self.info).unwrap_or_else(|e| {
@ -535,7 +532,6 @@ impl Host {
_ => { _ => {
warn!(target: "net", "Received event for unknown connection"); warn!(target: "net", "Received event for unknown connection");
} }
};
} }
if kill { if kill {
self.kill_connection(token, event_loop); self.kill_connection(token, event_loop);
@ -572,12 +568,13 @@ impl Host {
fn connection_timeout(&mut self, token: Token, event_loop: &mut EventLoop<Host>) { fn connection_timeout(&mut self, token: Token, event_loop: &mut EventLoop<Host>) {
self.kill_connection(token, event_loop) self.kill_connection(token, event_loop)
} }
fn kill_connection(&mut self, token: Token, _event_loop: &mut EventLoop<Host>) { fn kill_connection(&mut self, token: Token, _event_loop: &mut EventLoop<Host>) {
self.connections.remove(token); self.connections.remove(token);
} }
} }
impl Handler for Host { impl Handler for Host {
type Timeout = Token; type Timeout = Token;
type Message = HostMessage; type Message = HostMessage;
@ -661,4 +658,4 @@ impl Host {
} }
} }
} }
} }