(command: &mut Command, command_name: &'static str)
| 52 | } |
| 53 | |
| 54 | fn command_status(command: &mut Command, command_name: &'static str) -> Result<(), Error> { |
| 55 | let output = command_output(command, command_name)?; |
| 56 | if output.status.success() { |
| 57 | Ok(()) |
| 58 | } else { |
| 59 | Err(Error::CommandFailed { |
| 60 | command: command_name, |
| 61 | status: output.status, |
| 62 | stdout: String::from_utf8_lossy(&output.stdout).to_string(), |
| 63 | stderr: String::from_utf8_lossy(&output.stderr).to_string(), |
| 64 | }) |
| 65 | } |
| 66 | } |
| 67 | |
| 68 | fn format_octal_mode(mode_bits: u32) -> String { |
| 69 | format!("{:04o}", mode_bits) |
no test coverage detected