(nav_state: &mut NavigationState, count: usize)
| 477 | } |
| 478 | |
| 479 | fn pop_stack(nav_state: &mut NavigationState, count: usize) { |
| 480 | // save the final state and pop the intermediate states that did nothing |
| 481 | if count == 0 { |
| 482 | return; |
| 483 | } |
| 484 | |
| 485 | let (top_position, top_command) = nav_state.pop().unwrap(); |
| 486 | let mut count = count-1; |
| 487 | loop { |
| 488 | // debug!(" ... loop count={}", count); |
| 489 | let (_, nav_command) = nav_state.top().unwrap(); |
| 490 | if (nav_command.starts_with("Move") || nav_command.starts_with("Zoom")) && nav_command != "MoveLastLocation" { |
| 491 | nav_state.pop(); |
| 492 | } |
| 493 | if count == 0 { |
| 494 | break; |
| 495 | }; |
| 496 | count -= 1; |
| 497 | }; |
| 498 | nav_state.push(top_position, top_command); |
| 499 | } |
| 500 | } |
| 501 | |
| 502 | fn speak<'r, 'c, 's:'c, 'm:'c>(rules_with_context: &'r mut SpeechRulesWithContext<'c,'s,'m>, mathml: Element<'c>, nav_node_id: String, full_read: bool) -> Result<String> { |
no test coverage detected