diff --git a/src/autorouter/invoker.rs b/src/autorouter/invoker.rs index c34c10f..bd32926 100644 --- a/src/autorouter/invoker.rs +++ b/src/autorouter/invoker.rs @@ -46,11 +46,11 @@ impl Execute { match self.step_catch_err(invoker) { Ok(InvokerStatus::Running) => Ok(InvokerStatus::Running), Ok(InvokerStatus::Finished) => { - invoker.history.do_(invoker.ongoing.take().unwrap()); + invoker.history.do_(invoker.ongoing_command.take().unwrap()); Ok(InvokerStatus::Finished) } Err(err) => { - invoker.ongoing = None; + invoker.ongoing_command = None; Err(err) } } @@ -76,7 +76,7 @@ impl Execute { pub struct Invoker { autorouter: Autorouter, history: History, - ongoing: Option, + ongoing_command: Option, } impl Invoker { @@ -88,15 +88,15 @@ impl Invoker { Self { autorouter, history, - ongoing: None, + ongoing_command: None, } } pub fn destruct(self) -> (Autorouter, History, Option) { - (self.autorouter, self.history, self.ongoing) + (self.autorouter, self.history, self.ongoing_command) } - #[debug_requires(self.ongoing.is_none())] + #[debug_requires(self.ongoing_command.is_none())] pub fn execute(&mut self, command: Command) -> Result<(), InvokerError> { let mut execute = self.execute_walk(command); @@ -113,14 +113,14 @@ impl Invoker { } } - #[debug_requires(self.ongoing.is_none())] + #[debug_requires(self.ongoing_command.is_none())] pub fn execute_walk(&mut self, command: Command) -> Execute { let execute = self.dispatch_command(&command); - self.ongoing = Some(command); + self.ongoing_command = Some(command); execute } - #[debug_requires(self.ongoing.is_none())] + #[debug_requires(self.ongoing_command.is_none())] fn dispatch_command(&mut self, command: &Command) -> Execute { match command { Command::Autoroute(selection) => { @@ -132,7 +132,7 @@ impl Invoker { } } - #[debug_requires(self.ongoing.is_none())] + #[debug_requires(self.ongoing_command.is_none())] pub fn undo(&mut self) -> Result<(), InvokerError> { let command = self.history.last_done()?; @@ -147,7 +147,7 @@ impl Invoker { //#[debug_requires(self.ongoing.is_none())] pub fn redo(&mut self) -> Result<(), InvokerError> { let command = self.history.last_undone()?.clone(); - let mut execute = self.dispatch_command(&command); + let mut execute = self.execute_walk(command); loop { let status = match execute.step(self) { @@ -161,7 +161,7 @@ impl Invoker { } } - #[debug_requires(self.ongoing.is_none())] + #[debug_requires(self.ongoing_command.is_none())] pub fn replay(&mut self, history: History) { let (done, undone) = history.destructure(); diff --git a/src/router/tracer.rs b/src/router/tracer.rs index ec066ed..1e9b071 100644 --- a/src/router/tracer.rs +++ b/src/router/tracer.rs @@ -172,7 +172,7 @@ impl<'a, R: RulesTrait> Tracer<'a, R> { #[debug_ensures(trace.path.len() == old(trace.path.len() - 1))] pub fn undo_step(&mut self, graph: &UnGraph, trace: &mut Trace) { - if let Head::Cane(head) = dbg!(trace.head) { + if let Head::Cane(head) = trace.head { trace.head = Draw::new(self.layout).undo_cane(head).unwrap(); } else { panic!(); diff --git a/tests/common/mod.rs b/tests/common/mod.rs index d0ee299..3753566 100644 --- a/tests/common/mod.rs +++ b/tests/common/mod.rs @@ -89,7 +89,6 @@ pub fn assert_single_layer_groundless_autoroute( .rules() .layer_layername(target_layer), ) { - dbg!(source_layername, target_layername); assert_eq!(source_layername, target_layername); if source_layername != layername { @@ -111,7 +110,6 @@ pub fn assert_single_layer_groundless_autoroute( .drawing() .primitive(target_dot) .maybe_net(); - dbg!(source_net, target_net); assert_eq!(source_net, target_net); let net = source_net.unwrap(); @@ -119,7 +117,6 @@ pub fn assert_single_layer_groundless_autoroute( if let Some(netname) = autorouter.board().layout().rules().net_netname(net) { // We don't route ground. if netname != "GND" { - dbg!(source_dot, target_dot); assert_eq!( unionfind.find(source_dot.petgraph_index()), unionfind.find(target_dot.petgraph_index()) @@ -150,7 +147,6 @@ pub fn assert_band_length( ) { let band = board.band_between_pins(source, target).unwrap(); let band_length = board.layout().band_length(band); - dbg!(band_length); assert!((band_length - length).abs() < epsilon); } diff --git a/tests/multilayer.rs b/tests/multilayer.rs index b8c86cc..e9bc68b 100644 --- a/tests/multilayer.rs +++ b/tests/multilayer.rs @@ -25,7 +25,6 @@ fn test_unrouted_lm317_breakout() { }, maybe_net: Some(1234), })); - let result = dbg!(result); assert!(matches!( result, Err(InvokerError::Autorouter(AutorouterError::CouldNotPlaceVia(