refactor: move ProgramWriter to common.rs

This commit is contained in:
Andrew Phillips (aider)
2025-05-22 09:48:19 -03:00
parent beef2e773e
commit e1a5dbf0f1
5 changed files with 19 additions and 32 deletions

15
src/common.rs Normal file
View File

@@ -0,0 +1,15 @@
use std::io::Write;
pub struct ProgramWriter {
stdin: std::process::ChildStdin,
}
impl Write for ProgramWriter {
fn write(&mut self, buf: &[u8]) -> std::io::Result<usize> {
self.stdin.write(buf)
}
fn flush(&mut self) -> std::io::Result<()> {
self.stdin.flush()
}
}