(section_display: &[SectionDisplay], current: usize)
| 674 | } |
| 675 | |
| 676 | fn find_next_symbol(section_display: &[SectionDisplay], current: usize) -> Option<usize> { |
| 677 | section_display |
| 678 | .iter() |
| 679 | .flat_map(|s| s.symbols.iter()) |
| 680 | .skip_while(|s| s.symbol != current) |
| 681 | .nth(1) |
| 682 | .map(|s| s.symbol) |
| 683 | // Wrap around to the first symbol if we're at the end of the list |
| 684 | .or_else(|| find_first_symbol(section_display)) |
| 685 | } |
| 686 | |
| 687 | fn find_first_symbol(section_display: &[SectionDisplay]) -> Option<usize> { |
| 688 | section_display.iter().flat_map(|s| s.symbols.iter()).next().map(|s| s.symbol) |
no test coverage detected