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)
| 143 | /// |
| 144 | /// Returns None if the path doesn't match the expected format |
| 145 | fn 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 |
| 156 | pub async fn get_spec(client: &Client, name: &str, ver: usize) -> Result<String> { |