(output: &str)
| 152 | } |
| 153 | |
| 154 | fn parse_io_platform_uuid(output: &str) -> Option<String> { |
| 155 | output.lines().find_map(|line| { |
| 156 | let (_, value) = line.split_once("\"IOPlatformUUID\"")?; |
| 157 | let (_, value) = value.split_once('=')?; |
| 158 | value |
| 159 | .trim() |
| 160 | .trim_matches('"') |
| 161 | .split_whitespace() |
| 162 | .next() |
| 163 | .filter(|value| !value.is_empty()) |
| 164 | .map(ToOwned::to_owned) |
| 165 | }) |
| 166 | } |
| 167 | |
| 168 | #[cfg(test)] |
| 169 | mod tests { |
no test coverage detected