Function canonicalize_url

Source
pub fn canonicalize_url(url: &str) -> Result<String, Error>
Expand description

Canonicalizes a git+ url the same as cargo.

This is similar to cargo’s CanonicalUrl, which previously was only used for git+ url’s, but since cargo 1.85.0 is now used as part of the hash for all sources. Note that cargo removes queries and fragments only from git+ URLs and that happens before canonicalization, so this function does not handle them specifically as we only care about sparse and git registry URLs