(version: &str)
| 7 | |
| 8 | impl BrowserVersion { |
| 9 | pub fn from_string(version: &str) -> Result<Self, ParseIntError> { |
| 10 | let parts: Vec<&str> = version.split('.').collect(); |
| 11 | if parts.is_empty() { |
| 12 | return Ok(BrowserVersion(version.parse()?, 0)); |
| 13 | } |
| 14 | let major: u16 = parts[0].parse()?; |
| 15 | let minor: u16 = if parts.len() > 1 { parts[1].parse()? } else { 0 }; |
| 16 | Ok(Self(major, minor)) |
| 17 | } |
| 18 | |
| 19 | pub fn from_string_as_range(version: &str) -> Result<(Self, Self), ParseIntError> { |
| 20 | if version == "all" { |
nothing calls this directly
no test coverage detected