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

Method parse_single_component

euralios_std/src/path.rs:766–775  ·  view source on GitHub ↗

parse a given byte sequence into the corresponding path component

(&self, comp: &'b [u8])

Source from the content-addressed store, hash-verified

764
765 // parse a given byte sequence into the corresponding path component
766 fn parse_single_component<'b>(&self, comp: &'b [u8]) -> Option<Component<'b>> {
767 match comp {
768 b"." => None, // . components are normalized away, except at
769 // the beginning of a path, which is treated
770 // separately via `include_cur_dir`
771 b".." => Some(Component::ParentDir),
772 b"" => None,
773 _ => Some(Component::Normal(unsafe { u8_slice_as_os_str(comp) })),
774 }
775 }
776
777 // parse a component from the left, saying how many bytes to consume to
778 // remove the component

Callers 2

parse_next_componentMethod · 0.80

Calls 1

u8_slice_as_os_strFunction · 0.85

Tested by

no test coverage detected