(&mut self)
| 859 | |
| 860 | impl<'a> DoubleEndedIterator for Components<'a> { |
| 861 | fn next_back(&mut self) -> Option<Component<'a>> { |
| 862 | while !self.finished() { |
| 863 | match self.back { |
| 864 | State::Body if self.path.len() > self.len_before_body() => { |
| 865 | let (size, comp) = self.parse_next_component_back(); |
| 866 | self.path = &self.path[..self.path.len() - size]; |
| 867 | if comp.is_some() { |
| 868 | return comp; |
| 869 | } |
| 870 | } |
| 871 | State::Body => { |
| 872 | self.back = State::StartDir; |
| 873 | } |
| 874 | State::StartDir => { |
| 875 | if self.has_physical_root { |
| 876 | self.path = &self.path[..self.path.len() - 1]; |
| 877 | return Some(Component::RootDir); |
| 878 | } else if self.include_cur_dir() { |
| 879 | self.path = &self.path[..self.path.len() - 1]; |
| 880 | return Some(Component::CurDir); |
| 881 | } |
| 882 | } |
| 883 | State::Done => unreachable!(), |
| 884 | } |
| 885 | } |
| 886 | None |
| 887 | } |
| 888 | } |
| 889 | |
| 890 | impl<'a> cmp::PartialEq for Components<'a> { |
no test coverage detected