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

View File

@@ -1,5 +1,3 @@
#![allow(unused)]
use std::{ use std::{
fs::{File, OpenOptions}, fs::{File, OpenOptions},
path::PathBuf, path::PathBuf,

View File

@@ -1,4 +1,4 @@
use anyhow::{anyhow, Context, Result}; use anyhow::{anyhow, Result};
use std::{ use std::{
fs::File, fs::File,
path::{Path, PathBuf}, path::{Path, PathBuf},
@@ -37,7 +37,7 @@ fn get_containers(container: &str) -> Result<[String; 2]> {
} }
pub fn import(container: &str, file: &Path) -> Result<()> { pub fn import(container: &str, file: &Path) -> Result<()> {
let [db_container, app_containers] = get_containers(container)?; let [db_container, _] = get_containers(container)?;
let dump_file = file.to_string_lossy(); let dump_file = file.to_string_lossy();
eprintln!("stopping all containers"); eprintln!("stopping all containers");