(input: &str)
| 60 | |
| 61 | impl RepoUrl { |
| 62 | pub fn parse(input: &str) -> Result<Self> { |
| 63 | let (url, host) = parse_url(input)?; |
| 64 | let input = input.to_string(); |
| 65 | let normalized = format!("{url}"); |
| 66 | let sha256_base64 = sha256_base64(&normalized); |
| 67 | |
| 68 | Ok(Self { |
| 69 | input, |
| 70 | normalized, |
| 71 | host, |
| 72 | path: url.path().to_string(), |
| 73 | sha256: sha256_base64, |
| 74 | }) |
| 75 | } |
| 76 | |
| 77 | pub fn is_valid_url(input: &str) -> bool { |
| 78 | Self::parse(input).is_ok() |
nothing calls this directly
no test coverage detected