Skip to main content

encode_path_segment

Function encode_path_segment 

Source
pub fn encode_path_segment(value: &str) -> String
Expand description

Percent-encodes a value so it is one path segment.

Only the unreserved set from RFC 3986 is left alone, so /, spaces and the rest are escaped and a file id cannot break out of its segment. Written here rather than pulling in a crate for four lines.