MCPcopy Create free account
hub / github.com/csskit/csskit / get_csswg_commit_sha

Function get_csswg_commit_sha

crates/csskit_spec_generator/src/fetch_cached.rs:125–130  ·  view source on GitHub ↗

Gets the commit SHA of the csswg-drafts repository main branch Returns the SHA from the GitHub API tree response

(client: &Client)

Source from the content-addressed store, hash-verified

123///
124/// Returns the SHA from the GitHub API tree response
125pub async fn get_csswg_commit_sha(client: &Client) -> Result<String> {
126 let text = fetch_cached(client, GITHUB_CSSWG_TREE_URL, "index.json").await?;
127 let v: Value = serde_json::from_str(&text)?;
128 let sha = v["sha"].as_str().ok_or_else(|| anyhow!("Failed to extract SHA from GitHub API response"))?.to_string();
129 Ok(sha)
130}
131
132/// Extracts directory paths from the GitHub API tree response
133fn extract_tree_directories(tree_value: &Value) -> Result<Vec<String>> {

Callers 1

mainFunction · 0.85

Calls 2

fetch_cachedFunction · 0.85
as_strMethod · 0.45

Tested by

no test coverage detected