chore: update & fmt & clippy

This commit is contained in:
MystiPanda
2024-06-12 10:00:22 +08:00
parent fb6ffd8e09
commit 75cd7dd4b9
18 changed files with 100 additions and 127 deletions

View File

@@ -137,7 +137,7 @@ pub fn delete_log() -> Result<()> {
}
let service_log_dir = log_dir.join("service");
for file in fs::read_dir(&service_log_dir)?.flatten() {
for file in fs::read_dir(service_log_dir)?.flatten() {
let _ = process_file(file);
}
@@ -318,11 +318,11 @@ pub fn startup_script() -> Result<()> {
Some(dir) => {
let _ = Command::new(shell)
.current_dir(dir.to_path_buf())
.args(&[path])
.args([path])
.output()?;
}
None => {
let _ = Command::new(shell).args(&[path]).output()?;
let _ = Command::new(shell).args([path]).output()?;
}
}
}

View File

@@ -205,7 +205,6 @@ pub fn create_window(app_handle: &AppHandle) {
}
Err(_) => {
log::error!("failed to create window");
return;
}
}
}

View File

@@ -30,7 +30,7 @@ pub fn check_singleton() -> Result<()> {
let param = argvs[1].as_str();
if param.starts_with("clash:") {
reqwest::get(format!(
"http://127.0.0.1:{port}/commands/scheme?param={param}"
"http://127.0.0.1:{port}/commands/scheme?param={param}"
))
.await?
.text()