(raw_url: &str)
| 379 | } |
| 380 | |
| 381 | fn parse_host(raw_url: &str) -> Result<String> { |
| 382 | let url = Url::parse(raw_url).with_context(|| format!("invalid URL `{raw_url}`"))?; |
| 383 | url.host_str() |
| 384 | .map(|value| value.to_string()) |
| 385 | .context("URL missing host") |
| 386 | } |
| 387 | |
| 388 | fn non_empty_opt(value: &str) -> Option<String> { |
| 389 | let trimmed = value.trim(); |
no test coverage detected