MCPcopy Create free account
hub / github.com/bendudson/EuraliOS / parse_next_component_back

Method parse_next_component_back

euralios_std/src/path.rs:790–798  ·  view source on GitHub ↗

parse a component from the right, saying how many bytes to consume to remove the component

(&self)

Source from the content-addressed store, hash-verified

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) {

Callers 2

trim_rightMethod · 0.80
next_backMethod · 0.80

Calls 5

len_before_bodyMethod · 0.80
iterMethod · 0.80
is_sep_byteMethod · 0.80
lenMethod · 0.45

Tested by

no test coverage detected