fix wasm and finish refactor

This commit is contained in:
John Smith
2022-01-04 14:25:32 -05:00
parent 2564d35cc1
commit 3035bc079f
16 changed files with 133 additions and 156 deletions
+4 -4
View File
@@ -32,8 +32,8 @@ impl ConnectionTable {
Ok(())
}
pub fn get_connection(&self, descriptor: &ConnectionDescriptor) -> Option<NetworkConnection> {
self.conn_by_addr.get(descriptor).cloned()
pub fn get_connection(&self, descriptor: ConnectionDescriptor) -> Option<NetworkConnection> {
self.conn_by_addr.get(&descriptor).cloned()
}
pub fn connection_count(&self) -> usize {
@@ -42,10 +42,10 @@ impl ConnectionTable {
pub fn remove_connection(
&mut self,
descriptor: &ConnectionDescriptor,
descriptor: ConnectionDescriptor,
) -> Result<NetworkConnection, String> {
self.conn_by_addr
.remove(descriptor)
.remove(&descriptor)
.ok_or_else(|| format!("Connection not in table: {:?}", descriptor))
}
}