feat: add formatting command to package.json and update pre-commit hook for cargo fmt

This commit is contained in:
Tunglies
2025-05-20 22:58:05 +08:00
parent 400efa00ec
commit 420b0a254a
5 changed files with 10 additions and 7 deletions

View File

@@ -58,7 +58,8 @@ impl MihomoManager {
url: String,
data: Option<serde_json::Value>,
) -> Result<serde_json::Value, String> {
let client_response = self.client
let client_response = self
.client
.request(method.clone(), &url)
.json(&data.unwrap_or(json!({})))
.send()

View File

@@ -1,4 +1,4 @@
use std::sync::{Arc, Mutex};
use std::sync::{Arc, Mutex};
pub struct MihomoData {
pub(crate) proxies: serde_json::Value,
@@ -24,5 +24,4 @@ impl Drop for MihomoManager {
fn drop(&mut self) {
println!("Dropping MihomoManager");
}
}
}

View File

@@ -26,4 +26,4 @@ async fn test_refresh_providers_proxies() {
let providers = manager.get_providers_proxies();
assert_eq!(proxies, serde_json::Value::Null);
assert_ne!(providers, serde_json::Value::Null);
}
}