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

Method parse_next_component

euralios_std/src/path.rs:779–786  ·  view source on GitHub ↗

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

(&self)

Source from the content-addressed store, hash-verified

777 // parse a component from the left, saying how many bytes to consume to
778 // remove the component
779 fn parse_next_component(&self) -> (usize, Option<Component<'a>>) {
780 debug_assert!(self.front == State::Body);
781 let (extra, comp) = match self.path.iter().position(|b| self.is_sep_byte(*b)) {
782 None => (0, self.path),
783 Some(i) => (1, &self.path[..i]),
784 };
785 (comp.len() + extra, self.parse_single_component(comp))
786 }
787
788 // parse a component from the right, saying how many bytes to consume to
789 // remove the component

Callers 2

trim_leftMethod · 0.80
nextMethod · 0.80

Calls 4

iterMethod · 0.80
is_sep_byteMethod · 0.80
lenMethod · 0.45

Tested by

no test coverage detected