()
| 42 | None |
| 43 | } |
| 44 | } |
| 45 | |
| 46 | fn find_next_choice(&self, index: usize) -> Option<&usize> { |
| 47 | self.choices.range(index..).next().map(|(i, _)| i) |
| 48 | } |
| 49 | |
| 50 | fn update_figures(&mut self, index: usize, distance: &str, position: &str, command: Command) { |
| 51 | self.figures |
| 52 | .entry(index) |
| 53 | .or_default() |
| 54 | .push(distance, position, command); |
| 55 | } |
| 56 | |
| 57 | fn change_figure(&mut self, index: usize, distance: &str, position: &str) -> Command { |
| 58 | let pos = format!("{distance}{position}"); |
| 59 | let mut idx = 0; |
| 60 | for i in (0..=index).rev() { |
| 61 | if let Some(fg) = self.figures.get(&i) { |
| 62 | if fg.0.contains_key(&pos) { |
| 63 | idx = i; |
| 64 | break; |
| 65 | } |
| 66 | } |
nothing calls this directly
no outgoing calls
no test coverage detected