Skip to main content

percent_encode_path_segment

Function percent_encode_path_segment 

Source
pub fn percent_encode_path_segment(s: &str) -> String
Expand description

Percent-encode a single URL path segment.

Keeps only A-Z a-z 0-9 - _ .. Used for tags, owner/repo names, package names, versions, and file names in release backend URLs so that identifiers like v1.0.0+build.1 or group/project are safely encoded (+%2B, /%2F). Unifies previously-duplicated sets in the GitHub/GitLab/Gitea release backends that produced diverging URLs for the same tag.