From 574bbbd8cc0c236119bdca328c0f1a3945d29ce5 Mon Sep 17 00:00:00 2001 From: sqlerrorthing <148702857+sqlerrorthing@users.noreply.github.com> Date: Mon, 3 Nov 2025 05:13:58 +0800 Subject: [PATCH] dereference in wrong place --- rust/crates/zaprett/src/cli/commands.rs | 2 +- rust/crates/zaprett/src/lib.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/rust/crates/zaprett/src/cli/commands.rs b/rust/crates/zaprett/src/cli/commands.rs index ed97180..b014fba 100644 --- a/rust/crates/zaprett/src/cli/commands.rs +++ b/rust/crates/zaprett/src/cli/commands.rs @@ -53,7 +53,7 @@ impl Command { ); } Command::SetAutostart { autostart } => { - if let Err(err) = set_autostart(autostart).await { + if let Err(err) = set_autostart(*autostart).await { error!("Failed to set auto start: {err}") } } diff --git a/rust/crates/zaprett/src/lib.rs b/rust/crates/zaprett/src/lib.rs index 00a5d5a..d22d434 100644 --- a/rust/crates/zaprett/src/lib.rs +++ b/rust/crates/zaprett/src/lib.rs @@ -28,10 +28,10 @@ pub static DEFAULT_START: &str = " --filter-udp=443 --dpi-desync=fake --dpi-desync-repeats=6 $hostlist "; -async fn set_autostart(autostart: &bool) -> Result<(), anyhow::Error> { +async fn set_autostart(autostart: bool) -> Result<(), anyhow::Error> { let autostart_path = MODULE_PATH.join("autostart"); - if *autostart { + if autostart { File::create(autostart_path).await?; } else { fs::remove_file(autostart_path).await?;