refactor: rename common.rs to plugins.rs and update imports
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
use crate::common::ProgramWriter;
|
use crate::plugins::ProgramWriter;
|
||||||
use anyhow::{Context, Result, anyhow};
|
use anyhow::{Context, Result, anyhow};
|
||||||
use log::*;
|
use log::*;
|
||||||
use std::env;
|
use std::env;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
use crate::common::ProgramWriter;
|
use crate::plugins::ProgramWriter;
|
||||||
use anyhow::{Context, Result, anyhow};
|
use anyhow::{Context, Result, anyhow};
|
||||||
use log::*;
|
use log::*;
|
||||||
use std::env;
|
use std::env;
|
||||||
|
|||||||
15
src/plugins.rs
Normal file
15
src/plugins.rs
Normal 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()
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user