Skip to content

Commit 3195dc1

Browse files
committed
byper
1 parent 2ce00ec commit 3195dc1

File tree

1 file changed

+6
-2
lines changed
  • crates/compilers/src/compilers/vyper

1 file changed

+6
-2
lines changed

crates/compilers/src/compilers/vyper/mod.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ use foundry_compilers_core::error::{Result, SolcError};
77
use semver::Version;
88
use serde::{de::DeserializeOwned, Serialize};
99
use std::{
10+
io::{self, Write},
1011
path::{Path, PathBuf},
1112
process::{Command, Stdio},
1213
str::FromStr,
@@ -152,8 +153,11 @@ impl Vyper {
152153
let mut child = cmd.spawn().map_err(self.map_io_err())?;
153154
debug!("spawned");
154155

155-
let stdin = child.stdin.as_mut().unwrap();
156-
serde_json::to_writer(stdin, input)?;
156+
{
157+
let mut stdin = io::BufWriter::new(child.stdin.take().unwrap());
158+
serde_json::to_writer(&mut stdin, input)?;
159+
stdin.flush().map_err(self.map_io_err())?;
160+
}
157161
debug!("wrote JSON input to stdin");
158162

159163
let output = child.wait_with_output().map_err(self.map_io_err())?;

0 commit comments

Comments
 (0)