aboutsummaryrefslogtreecommitdiff
path: root/crates/proc_macro_api/src/process.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/proc_macro_api/src/process.rs')
-rw-r--r--crates/proc_macro_api/src/process.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/crates/proc_macro_api/src/process.rs b/crates/proc_macro_api/src/process.rs
index 30bb1b687..99d05aef3 100644
--- a/crates/proc_macro_api/src/process.rs
+++ b/crates/proc_macro_api/src/process.rs
@@ -90,8 +90,10 @@ impl ProcMacroProcessSrv {
90fn client_loop(task_rx: Receiver<Task>, mut process: Process) { 90fn client_loop(task_rx: Receiver<Task>, mut process: Process) {
91 let (mut stdin, mut stdout) = process.stdio().expect("couldn't access child stdio"); 91 let (mut stdin, mut stdout) = process.stdio().expect("couldn't access child stdio");
92 92
93 let mut buf = String::new();
94
93 for Task { req, result_tx } in task_rx { 95 for Task { req, result_tx } in task_rx {
94 match send_request(&mut stdin, &mut stdout, req) { 96 match send_request(&mut stdin, &mut stdout, req, &mut buf) {
95 Ok(res) => result_tx.send(res).unwrap(), 97 Ok(res) => result_tx.send(res).unwrap(),
96 Err(err) => { 98 Err(err) => {
97 log::error!( 99 log::error!(
@@ -152,7 +154,8 @@ fn send_request(
152 mut writer: &mut impl Write, 154 mut writer: &mut impl Write,
153 mut reader: &mut impl BufRead, 155 mut reader: &mut impl BufRead,
154 req: Request, 156 req: Request,
157 buf: &mut String,
155) -> io::Result<Option<Response>> { 158) -> io::Result<Option<Response>> {
156 req.write(&mut writer)?; 159 req.write(&mut writer)?;
157 Response::read(&mut reader) 160 Response::read(&mut reader, buf)
158} 161}