Skip to main content

escape_segment

Function escape_segment 

Source
pub fn escape_segment(name: &str) -> String
Expand description

Escape a logical path segment for inclusion after either separator.

The escape is intentionally tiny: only leading > and leading \ are rewritten, because only the first byte after / participates in the decompose-boundary grammar. A literal leading > becomes \>; a literal leading \ becomes \\ so the escaped spelling itself can round-trip.