MCPcopy Create free account
hub / github.com/emwalker/digraph / parse

Method parse

backend/src/http/repo_url.rs:62–75  ·  view source on GitHub ↗
(input: &str)

Source from the content-addressed store, hash-verified

60
61impl 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()

Callers

nothing calls this directly

Calls 3

parse_urlFunction · 0.85
sha256_base64Function · 0.85
pathMethod · 0.80

Tested by

no test coverage detected