From 6eb07f76eb3ab7b130c0cbceb86ff50011b4de05 Mon Sep 17 00:00:00 2001 From: Jisu-Woniu <31986081+Jisu-Woniu@users.noreply.github.com> Date: Sun, 11 Feb 2024 00:04:24 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E2=99=BB=EF=B8=8F=20cleanup=20comm?= =?UTF-8?q?and=20execution=20process?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/user.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/user.rs b/src/user.rs index 26bd238..0241d43 100644 --- a/src/user.rs +++ b/src/user.rs @@ -44,14 +44,12 @@ mod tests { let builder_output = Command::new("id") .uid(builder_uid().ok_or_else(|| anyhow!("No such user: rsjudge-builder"))?) .gid(builder_gid().ok_or_else(|| anyhow!("No such group: rsjudge-builder"))?) - .spawn()? - .wait_with_output()?; + .output()?; println!("{}", String::from_utf8_lossy(&builder_output.stdout)); let runner_output = Command::new("id") .uid(runner_uid().ok_or_else(|| anyhow!("No such user: rsjudge-runner"))?) .gid(runner_gid().ok_or_else(|| anyhow!("No such group: rsjudge-runner"))?) - .spawn()? - .wait_with_output()?; + .output()?; println!("{}", String::from_utf8_lossy(&runner_output.stdout)); Ok(()) }