(&mut self)
| 826 | type Item = Component<'a>; |
| 827 | |
| 828 | fn next(&mut self) -> Option<Component<'a>> { |
| 829 | while !self.finished() { |
| 830 | match self.front { |
| 831 | State::StartDir => { |
| 832 | self.front = State::Body; |
| 833 | if self.has_physical_root { |
| 834 | debug_assert!(!self.path.is_empty()); |
| 835 | self.path = &self.path[1..]; |
| 836 | return Some(Component::RootDir); |
| 837 | } else if self.include_cur_dir() { |
| 838 | debug_assert!(!self.path.is_empty()); |
| 839 | self.path = &self.path[1..]; |
| 840 | return Some(Component::CurDir); |
| 841 | } |
| 842 | } |
| 843 | State::Body if !self.path.is_empty() => { |
| 844 | let (size, comp) = self.parse_next_component(); |
| 845 | self.path = &self.path[size..]; |
| 846 | if comp.is_some() { |
| 847 | return comp; |
| 848 | } |
| 849 | } |
| 850 | State::Body => { |
| 851 | self.front = State::Done; |
| 852 | } |
| 853 | State::Done => unreachable!(), |
| 854 | } |
| 855 | } |
| 856 | None |
| 857 | } |
| 858 | } |
| 859 | |
| 860 | impl<'a> DoubleEndedIterator for Components<'a> { |
no test coverage detected