pub fn trim_trailing_separator(input: &str) -> String
Removes trailing separators while preserving recognized roots.