Skip to content

Commit d09ed1c

Browse files
committed
fix: warning in network
1 parent 589cb9a commit d09ed1c

1 file changed

Lines changed: 2 additions & 8 deletions

File tree

src/network.rs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -98,14 +98,8 @@ impl Network {
9898

9999

100100
pub fn add_node_controller_view(&mut self, node_id: NodeId, node_type: NodeType, adjacents: &[NodeId]) {
101-
let drone = Node::new(node_id, node_type, adjacents.to_vec());
102-
for adj in adjacents {
103-
if let Some(node) = self.nodes.iter_mut().find(|n| n.id == *adj){
104-
node.add_adjacent(*adj);
105-
}
106-
}
107-
108-
self.nodes.push(drone)
101+
let node = Node::new(node_id, node_type, adjacents.to_vec());
102+
self.nodes.push(node);
109103
}
110104

111105
pub(crate) fn add_node(&mut self, new_node: Node) {

0 commit comments

Comments
 (0)