()
| 4 | use std::process::Command; |
| 5 | |
| 6 | fn part0() { |
| 7 | let output = Command::new("rustc") |
| 8 | .arg("--version") |
| 9 | .output().unwrap_or_else(|e| { |
| 10 | panic!("failed to execute process: {}", e) |
| 11 | }); |
| 12 | |
| 13 | if output.status.success() { |
| 14 | let s = String::from_utf8_lossy(&output.stdout); |
| 15 | |
| 16 | print!("rustc succeeded and stdout was:\n{}", s); |
| 17 | } else { |
| 18 | let s = String::from_utf8_lossy(&output.stderr); |
| 19 | |
| 20 | print!("rustc failed and stderr was:\n{}", s); |
| 21 | } |
| 22 | } |
| 23 | |
| 24 | pub fn main() { |
| 25 | part0(); |