From 8a3df7b25355eebb8f94ceccca7ee56c150f4e33 Mon Sep 17 00:00:00 2001 From: sqlerrorthing <148702857+sqlerrorthing@users.noreply.github.com> Date: Sat, 1 Nov 2025 07:31:35 +0800 Subject: [PATCH] ... --- rust/crates/zaprett/src/main.rs | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/rust/crates/zaprett/src/main.rs b/rust/crates/zaprett/src/main.rs index a39b45f..698bcab 100644 --- a/rust/crates/zaprett/src/main.rs +++ b/rust/crates/zaprett/src/main.rs @@ -15,7 +15,7 @@ use std::sync::LazyLock; use std::{error}; use std::{path::Path}; use sysctl::Sysctl; -use tokio::io::{AsyncReadExt, AsyncWriteExt}; +use tokio::io::{copy, AsyncReadExt, AsyncWriteExt}; use tokio::fs::File; use tokio::task; @@ -279,13 +279,6 @@ async fn service_status() -> bool { .ok() .and_then(|pid_str| pid_str.trim().parse::().ok()) .is_some() - /*match all_processes() { - Ok(iter) => iter - .filter_map(|rp| rp.ok()) - .filter_map(|p| p.stat().ok()) - .any(|st| st.pid == pid), - Err(_) => false, - }*/ } fn module_version() { @@ -306,15 +299,15 @@ pub async fn merge_files( output_path: impl AsRef, ) -> Result<(), Box> { let output_path = output_path.as_ref(); - let mut output_file = tokio::fs::File::create(output_path).await?; + let mut output_file = File::create(output_path).await?; for input in input_paths { let input_path = input.as_ref(); - let mut input_file = tokio::fs::File::open(input_path) + let mut input_file = File::open(input_path) .await .map_err(|e| format!("Failed to open {}: {}", input_path.display(), e))?; - tokio::io::copy(&mut input_file, &mut output_file) + copy(&mut input_file, &mut output_file) .await .map_err(|e| { format!(