fn format_root_path(root: &str) -> String
Helper function to format root path with leading slash if non-empty.