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

Function parse_spec_path

crates/csskit_spec_generator/src/fetch_cached.rs:145–153  ·  view source on GitHub ↗

Parses a spec path in the format "{name}-{version}" into (name, version) Returns None if the path doesn't match the expected format

(path: &str)

Source from the content-addressed store, hash-verified

143///
144/// Returns None if the path doesn't match the expected format
145fn parse_spec_path(path: &str) -> Option<(String, usize)> {
146 let (name, version_str) = path.rsplit_once('-')?;
147 let version = version_str.parse::<usize>().ok()?;
148 // Skip yearly snapshots (e.g., "css-2026")
149 if name == "css" {
150 return None;
151 }
152 Some((name.to_string(), version))
153}
154
155/// Fetches the HTML content for a specific CSS spec version
156pub async fn get_spec(client: &Client, name: &str, ver: usize) -> Result<String> {

Callers 1

get_spec_versionsFunction · 0.85

Calls 1

okMethod · 0.80

Tested by

no test coverage detected