chore: drop allow(unused) and clear what it hid

This commit is contained in:
2026-09-04 09:17:35 +00:00
parent ec4168769e
commit e10e1fb017
3 changed files with 7 additions and 14 deletions

View File

@@ -1,12 +1,7 @@
use anyhow::{anyhow, Context, Result};
use anyhow::{Context, Result};
use std::{
collections::VecDeque,
env,
ffi::OsStr,
fmt::Display,
fs::{File, OpenOptions},
os::unix::process::CommandExt,
path::PathBuf,
process::{Child, Command, Stdio},
};
@@ -77,20 +72,20 @@ impl CommandBuilder {
Ok(command)
}
pub fn exec_get_stdout(mut self) -> Result<String> {
pub fn exec_get_stdout(self) -> Result<String> {
Ok(String::from_utf8(self.build()?.output()?.stdout)?)
}
pub fn exec(mut self) -> Result<()> {
pub fn exec(self) -> Result<()> {
self.build()?.spawn()?.wait()?;
Ok(())
}
pub fn spawn(mut self) -> Result<(Child)> {
pub fn spawn(self) -> Result<Child > {
Ok(self.build()?.spawn()?)
}
pub fn exec_redirect_stdout(mut self, stdio: Stdio) -> Result<()> {
pub fn exec_redirect_stdout(self, stdio: Stdio) -> Result<()> {
self.build()?.stdout(stdio).spawn()?.wait()?;
Ok(())
}