Skip to main content

split_url_path

Function split_url_path 

Source
pub fn split_url_path(url: &str) -> (&str, &str)
Expand description

Split a URL into its path portion and any ?query / #fragment suffix. The split happens at the first occurrence of ? or # (whichever appears first); if neither is present the suffix is empty. The suffix is returned verbatim, including the leading ? / #.

Used by percent_encode_url and by callers that need to apply path-only transformations (e.g. directory-name overrides) before reattaching an opaque query/fragment.