(&self)
| 167 | } |
| 168 | |
| 169 | pub(crate) fn start_timer(&self) { |
| 170 | let executor = self.executor.clone(); |
| 171 | let command = self.command.clone(); |
| 172 | |
| 173 | self.timer.start( |
| 174 | slint::TimerMode::Repeated, |
| 175 | Duration::from_millis(30), |
| 176 | move || { |
| 177 | if let Some(mut cmd) = command.write().unwrap().pop_front() { |
| 178 | cmd.delete_delay(); |
| 179 | let result = if let Command::Figure { .. } = &cmd { |
| 180 | executor.show_fg(&cmd) |
| 181 | } else if let Command::Move { .. } = &cmd { |
| 182 | executor.show_move(&cmd) |
| 183 | } else { |
| 184 | Ok(()) |
| 185 | }; |
| 186 | if let Err(e) = result { |
| 187 | eprintln!("delay executors failed: {e}"); |
| 188 | } |
| 189 | } |
| 190 | }, |
| 191 | ); |
| 192 | } |
| 193 | } |
nothing calls this directly
no test coverage detected