(section_display: &[SectionDisplay], current: usize)
| 662 | } |
| 663 | |
| 664 | fn find_prev_symbol(section_display: &[SectionDisplay], current: usize) -> Option<usize> { |
| 665 | section_display |
| 666 | .iter() |
| 667 | .flat_map(|s| s.symbols.iter()) |
| 668 | .rev() |
| 669 | .skip_while(|s| s.symbol != current) |
| 670 | .nth(1) |
| 671 | .map(|s| s.symbol) |
| 672 | // Wrap around to the last symbol if we're at the beginning of the list |
| 673 | .or_else(|| find_last_symbol(section_display)) |
| 674 | } |
| 675 | |
| 676 | fn find_next_symbol(section_display: &[SectionDisplay], current: usize) -> Option<usize> { |
| 677 | section_display |
no test coverage detected