parse a component from the right, saying how many bytes to consume to remove the component
(&self)
| 788 | // parse a component from the right, saying how many bytes to consume to |
| 789 | // remove the component |
| 790 | fn parse_next_component_back(&self) -> (usize, Option<Component<'a>>) { |
| 791 | debug_assert!(self.back == State::Body); |
| 792 | let start = self.len_before_body(); |
| 793 | let (extra, comp) = match self.path[start..].iter().rposition(|b| self.is_sep_byte(*b)) { |
| 794 | None => (0, &self.path[start..]), |
| 795 | Some(i) => (1, &self.path[start + i + 1..]), |
| 796 | }; |
| 797 | (comp.len() + extra, self.parse_single_component(comp)) |
| 798 | } |
| 799 | |
| 800 | // trim away repeated separators (i.e., empty components) on the left |
| 801 | fn trim_left(&mut self) { |
no test coverage detected