MCPcopy Create free account
hub / github.com/ahgamut/rust-ape-example / part0

Function part0

src/bin/std_misc_process.rs:6–22  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

4use std::process::Command;
5
6fn 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
24pub fn main() {
25 part0();

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected