Skip to main content

is_plain_name

Function is_plain_name 

Source
fn is_plain_name(segment: &str) -> bool
Expand description

Whether segment is a single portable filename component: it holds no platform separator and parses to exactly one Component::Normal equal to itself.

Manifest paths spell separators with / only, so a \ (a separator on Windows), a drive prefix (C:), or any rooted form would let the OS re-split the segment and slip past the lexical .. normalization in resolve_relative. Backslash is rejected on every platform so a manifest resolves identically everywhere, not only where \ happens to be a separator.