MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / split_path_segments

Function split_path_segments

crates/openshell-supervisor-network/src/l7/path.rs:230–235  ·  view source on GitHub ↗
(decoded: &[u8])

Source from the content-addressed store, hash-verified

228}
229
230fn split_path_segments(decoded: &[u8]) -> Vec<&[u8]> {
231 // decoded is guaranteed to start with `/`. Skip the leading `/` and
232 // split on subsequent `/` bytes. The sentinel byte for encoded slashes
233 // never matches, so it stays inside its segment.
234 decoded[1..].split(|&b| b == b'/').collect()
235}
236
237fn resolve_dot_segments(segments: Vec<&[u8]>) -> Result<Vec<Vec<u8>>, CanonicalizeError> {
238 let mut stack: Vec<Vec<u8>> = Vec::with_capacity(segments.len());

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected