mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-11-08 19:22:44 +08:00
style: adjust rustfmt max_width to 120
This commit is contained in:
@@ -94,9 +94,6 @@ impl CoreManager {
|
||||
}
|
||||
|
||||
async fn reload_config(&self, path: &str) -> Result<(), MihomoError> {
|
||||
handle::Handle::mihomo()
|
||||
.await
|
||||
.reload_config(true, path)
|
||||
.await
|
||||
handle::Handle::mihomo().await.reload_config(true, path).await
|
||||
}
|
||||
}
|
||||
|
||||
@@ -78,10 +78,7 @@ impl CoreManager {
|
||||
|
||||
fn after_core_process(&self) {
|
||||
let app_handle = Handle::app_handle();
|
||||
tauri_plugin_clash_verge_sysinfo::set_app_core_mode(
|
||||
app_handle,
|
||||
self.get_running_mode().to_string(),
|
||||
);
|
||||
tauri_plugin_clash_verge_sysinfo::set_app_core_mode(app_handle, self.get_running_mode().to_string());
|
||||
}
|
||||
|
||||
#[cfg(target_os = "windows")]
|
||||
@@ -89,11 +86,7 @@ impl CoreManager {
|
||||
use crate::{config::Config, constants::timing};
|
||||
use backoff::{Error as BackoffError, ExponentialBackoff};
|
||||
|
||||
let needs_service = Config::verge()
|
||||
.await
|
||||
.latest_arc()
|
||||
.enable_tun_mode
|
||||
.unwrap_or(false);
|
||||
let needs_service = Config::verge().await.latest_arc().enable_tun_mode.unwrap_or(false);
|
||||
|
||||
if !needs_service {
|
||||
return;
|
||||
@@ -121,9 +114,7 @@ impl CoreManager {
|
||||
if matches!(manager.current(), ServiceStatus::Ready) {
|
||||
Ok(())
|
||||
} else {
|
||||
Err(BackoffError::transient(anyhow::anyhow!(
|
||||
"Service not ready"
|
||||
)))
|
||||
Err(BackoffError::transient(anyhow::anyhow!("Service not ready")))
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -54,8 +54,7 @@ impl CoreManager {
|
||||
self.set_running_child_sidecar(child);
|
||||
self.set_running_mode(RunningMode::Sidecar);
|
||||
|
||||
let shared_writer: SharedWriter =
|
||||
std::sync::Arc::new(tokio::sync::Mutex::new(sidecar_writer().await?));
|
||||
let shared_writer: SharedWriter = std::sync::Arc::new(tokio::sync::Mutex::new(sidecar_writer().await?));
|
||||
|
||||
AsyncHandler::spawn(|| async move {
|
||||
while let Some(event) = rx.recv().await {
|
||||
@@ -64,12 +63,7 @@ impl CoreManager {
|
||||
| tauri_plugin_shell::process::CommandEvent::Stderr(line) => {
|
||||
let mut now = DeferredNow::default();
|
||||
let message = CompactString::from(String::from_utf8_lossy(&line).as_ref());
|
||||
write_sidecar_log(
|
||||
shared_writer.lock().await,
|
||||
&mut now,
|
||||
Level::Error,
|
||||
&message,
|
||||
);
|
||||
write_sidecar_log(shared_writer.lock().await, &mut now, Level::Error, &message);
|
||||
CLASH_LOGGER.append_log(message).await;
|
||||
}
|
||||
tauri_plugin_shell::process::CommandEvent::Terminated(term) => {
|
||||
@@ -81,12 +75,7 @@ impl CoreManager {
|
||||
} else {
|
||||
CompactString::from("Process terminated")
|
||||
};
|
||||
write_sidecar_log(
|
||||
shared_writer.lock().await,
|
||||
&mut now,
|
||||
Level::Info,
|
||||
&message,
|
||||
);
|
||||
write_sidecar_log(shared_writer.lock().await, &mut now, Level::Info, &message);
|
||||
CLASH_LOGGER.clear_logs().await;
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user