1 2 3 4 5 6 7 8 9
//! URL utilities. use url::Url; /// Get the path from a URL. pub fn get_url_path(url: &str) -> Option<String> { let url = Url::parse(url).ok()?; Some(url.path().to_string()) }