fix: apply automatic clippy fixes across workspace

This commit is contained in:
Riz Ashraf committed 2026-09-21 11:41:55 +01:00
1 parent 73ab5037d8
commit 5da422d23a
12 files changed
+99 -115

No files matched your search

+11 -11
View File
@@ -14,7 +14,7 @@ impl Drop for ChildGuard {
fn send_message(stdin: &mut std::process::ChildStdin, msg: Value) {
let s = serde_json::to_string(&msg).unwrap();
let payload = format!("{}\n", s);
let payload = format!("{s}\n");
stdin.write_all(payload.as_bytes()).unwrap();
stdin.flush().unwrap();
}
@@ -56,9 +56,9 @@ async fn test_full_system_e2e_performance() {
let nvim_exe = debug_dir.join(format!("{}{}", nvim_name, std::env::consts::EXE_SUFFIX));
let stub_exe = debug_dir.join(format!("mcp-memory-stub{}", std::env::consts::EXE_SUFFIX));
assert!(server_exe.exists(), "Server not found at {:?}", server_exe);
assert!(nvim_exe.exists(), "Nvim not found at {:?}", nvim_exe);
assert!(stub_exe.exists(), "Stub not found at {:?}", stub_exe);
assert!(server_exe.exists(), "Server not found at {server_exe:?}");
assert!(nvim_exe.exists(), "Nvim not found at {nvim_exe:?}");
assert!(stub_exe.exists(), "Stub not found at {stub_exe:?}");
// 1. Start Server
let _server = ChildGuard(
@@ -83,7 +83,7 @@ async fn test_full_system_e2e_performance() {
let mut started = false;
for _ in 0..30 {
if let Ok(resp) = client
.get(format!("http://127.0.0.1:{}/health", test_port))
.get(format!("http://127.0.0.1:{test_port}/health"))
.send()
.await
&& resp.status().is_success()
@@ -99,7 +99,7 @@ async fn test_full_system_e2e_performance() {
let mut stub = ChildGuard(
Command::new(&stub_exe)
.arg("--target")
.arg(format!("http://127.0.0.1:{}", test_port))
.arg(format!("http://127.0.0.1:{test_port}"))
.env("MCP_MEMORY_STORE_DIR", temp_dir.to_str().unwrap())
.env("MCP_AUTH_TOKEN", test_auth_token)
.env("RUST_LOG", "debug")
@@ -144,7 +144,7 @@ async fn test_full_system_e2e_performance() {
send_message(&mut stub_stdin, tools_req);
} else {
let s = serde_json::to_string(&tools_req).unwrap();
stub_stdin.write_all(format!("{}\n", s).as_bytes()).unwrap();
stub_stdin.write_all(format!("{s}\n").as_bytes()).unwrap();
stub_stdin.flush().unwrap();
}
@@ -156,7 +156,7 @@ async fn test_full_system_e2e_performance() {
assert_eq!(resp["id"], i);
}
let stub_duration = start_time.elapsed();
println!("Stub 100 requests: {:?}", stub_duration);
println!("Stub 100 requests: {stub_duration:?}");
// Send 100 concurrent-like sequential rapid requests to Win-Nvim
println!("Starting 100 requests to nvim...");
@@ -173,7 +173,7 @@ async fn test_full_system_e2e_performance() {
send_message(&mut nvim_stdin, tools_req);
} else {
let s = serde_json::to_string(&tools_req).unwrap();
nvim_stdin.write_all(format!("{}\n", s).as_bytes()).unwrap();
nvim_stdin.write_all(format!("{s}\n").as_bytes()).unwrap();
nvim_stdin.flush().unwrap();
}
@@ -187,8 +187,8 @@ async fn test_full_system_e2e_performance() {
}
let nvim_duration = start_time_nvim.elapsed();
println!("Stub 100 requests: {:?}", stub_duration);
println!("Win-Nvim 100 requests: {:?}", nvim_duration);
println!("Stub 100 requests: {stub_duration:?}");
println!("Win-Nvim 100 requests: {nvim_duration:?}");
let _ = std::fs::remove_dir_all(temp_dir);
}
+3 -5
View File
@@ -31,8 +31,7 @@ async fn test_stub_connection_refused() {
assert!(
res.is_ok(),
"Stub hung on connection refused! Took {:?}",
elapsed
"Stub hung on connection refused! Took {elapsed:?}"
);
}
@@ -65,7 +64,7 @@ async fn test_stub_handles_eof_cleanly() {
let res = tokio::time::timeout(Duration::from_secs(5), child.wait()).await;
let elapsed = start.elapsed();
assert!(res.is_ok(), "Stub hung after EOF! Took {:?}", elapsed);
assert!(res.is_ok(), "Stub hung after EOF! Took {elapsed:?}");
}
#[tokio::test]
@@ -102,7 +101,6 @@ async fn test_stub_sse_fallback_failure() {
assert!(
res.is_ok(),
"Stub hung on fallback failure! Took {:?}",
elapsed
"Stub hung on fallback failure! Took {elapsed:?}"
);
}