(operation: &str, output: &CommandOutput)
| 177 | } |
| 178 | |
| 179 | fn unavailable(operation: &str, output: &CommandOutput) -> ChangeSourceError { |
| 180 | let detail = String::from_utf8_lossy(&output.stderr); |
| 181 | ChangeSourceError::Unavailable(format!( |
| 182 | "{operation} exited with {}{}", |
| 183 | output.status, |
| 184 | if detail.trim().is_empty() { |
| 185 | String::new() |
| 186 | } else { |
| 187 | format!(": {}", detail.trim()) |
| 188 | } |
| 189 | )) |
| 190 | } |
| 191 | |
| 192 | #[cfg(test)] |
| 193 | mod tests { |
no outgoing calls
no test coverage detected