fix: remove unnecessary flush() calls

Because we are writing to a pipe, the `flush()` call is unnecessary, so removing
these saves us some syscalls.
This commit is contained in:
Michael Bolin
2025-08-28 21:54:28 -07:00
parent 5d2d3002ef
commit 89a47429fe
2 changed files with 1 additions and 8 deletions
+1 -4
View File
@@ -129,10 +129,7 @@ impl McpClient {
error!("failed to write newline to child stdin");
break;
}
if stdin.flush().await.is_err() {
error!("failed to flush child stdin");
break;
}
// No explicit flush needed on a pipe; write_all is sufficient.
}
Err(e) => error!("failed to serialize JSONRPCMessage: {e}"),
}
-4
View File
@@ -134,10 +134,6 @@ pub async fn run_main(
error!("Failed to write newline to stdout: {e}");
break;
}
if let Err(e) = stdout.flush().await {
error!("Failed to flush stdout: {e}");
break;
}
}
Err(e) => error!("Failed to serialize JSONRPCMessage: {e}"),
}