dereference in wrong place

This commit is contained in:
sqlerrorthing
2025-11-03 05:13:58 +08:00
parent b5e37044e2
commit 574bbbd8cc
2 changed files with 3 additions and 3 deletions

View File

@@ -53,7 +53,7 @@ impl Command {
); );
} }
Command::SetAutostart { autostart } => { 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}") error!("Failed to set auto start: {err}")
} }
} }

View File

@@ -28,10 +28,10 @@ pub static DEFAULT_START: &str = "
--filter-udp=443 --dpi-desync=fake --dpi-desync-repeats=6 $hostlist --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"); let autostart_path = MODULE_PATH.join("autostart");
if *autostart { if autostart {
File::create(autostart_path).await?; File::create(autostart_path).await?;
} else { } else {
fs::remove_file(autostart_path).await?; fs::remove_file(autostart_path).await?;