(operation: &str, output: &CommandOutput)
| 155 | } |
| 156 | |
| 157 | fn unavailable(operation: &str, output: &CommandOutput) -> ChangeSourceError { |
| 158 | let detail = String::from_utf8_lossy(&output.stderr); |
| 159 | ChangeSourceError::Unavailable(format!( |
| 160 | "{operation} exited with {}{}", |
| 161 | output.status, |
| 162 | if detail.trim().is_empty() { |
| 163 | String::new() |
| 164 | } else { |
| 165 | format!(": {}", detail.trim()) |
| 166 | } |
| 167 | )) |
| 168 | } |
| 169 | |
| 170 | fn parse_version(version: &str) -> Option<(u64, u64, u64)> { |
| 171 | let mut parts = version.split_whitespace().next()?.split('.'); |
no outgoing calls
no test coverage detected