Purging .derefs, fixing clippy warnings. (#1890)

* Fixing clippy warnings

* Purging derefs

* Simplifying engine derefs

* Simplifying more engine derefs
This commit is contained in:
Tomasz Drwięga
2016-08-10 16:29:40 +02:00
committed by Arkadiy Paronyan
parent 8018b69440
commit a427208f79
42 changed files with 160 additions and 182 deletions

View File

@@ -787,7 +787,7 @@ impl Host {
let entry = NodeEntry { id: s.id().unwrap().clone(), endpoint: NodeEndpoint { address: address, udp_port: address.port() } };
self.nodes.write().add_node(Node::new(entry.id.clone(), entry.endpoint.clone()));
let mut discovery = self.discovery.lock();
if let Some(ref mut discovery) = *discovery.deref_mut() {
if let Some(ref mut discovery) = *discovery {
discovery.add_node(entry);
}
}

View File

@@ -46,7 +46,7 @@ impl TestProtocol {
}
pub fn got_packet(&self) -> bool {
self.packet.lock().deref()[..] == b"hello"[..]
self.packet.lock()[..] == b"hello"[..]
}
pub fn got_timeout(&self) -> bool {