refactor: rename common.rs to plugins.rs and update imports

This commit is contained in:
Andrew Phillips (aider)
2025-05-22 09:57:19 -03:00
parent e1a5dbf0f1
commit d6a25e8b77
3 changed files with 17 additions and 2 deletions

View File

@@ -1,4 +1,4 @@
use crate::common::ProgramWriter;
use crate::plugins::ProgramWriter;
use anyhow::{Context, Result, anyhow};
use log::*;
use std::env;

View File

@@ -1,4 +1,4 @@
use crate::common::ProgramWriter;
use crate::plugins::ProgramWriter;
use anyhow::{Context, Result, anyhow};
use log::*;
use std::env;

15
src/plugins.rs Normal file
View File

@@ -0,0 +1,15 @@
pub(crate) 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()
}
}