From 5ec75c3062f0b8eeb214df88db9ecae4a5591498 Mon Sep 17 00:00:00 2001 From: Weird Constructor Date: Sun, 24 Jul 2022 19:12:43 +0200 Subject: [PATCH] Fix find_unconnected_ports --- src/matrix.rs | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/matrix.rs b/src/matrix.rs index 21653b7..3585bad 100644 --- a/src/matrix.rs +++ b/src/matrix.rs @@ -385,11 +385,7 @@ impl Cell { /// Finds all dangling ports in the specified direction. /// With `dir` you can specify input with `CellDir::T`, output with `CellDir::B` /// and any with `CellDir::C`. - pub fn find_unconnected_ports( - &self, - m: &Matrix, - dir: CellDir, - ) -> Vec<(CellDir, (usize, usize))> { + pub fn find_unconnected_ports(&self, m: &Matrix, dir: CellDir) -> Vec { let mut unused_ports = vec![]; let options: &[CellDir] = if dir == CellDir::C { @@ -402,9 +398,7 @@ impl Cell { for dir in options { if self.is_port_dir_connected(m, *dir).is_none() { - if let Some(pos) = dir.offs_pos((self.x as usize, self.y as usize)) { - unused_ports.push((*dir, pos)); - } + unused_ports.push(*dir); } }