refactor: Simplify filter plugin return values and apply io::copy directly

Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat>
This commit is contained in:
Andrew Phillips
2025-09-02 12:40:28 -03:00
parent 2773855cec
commit e7cae3d12f
2 changed files with 2 additions and 4 deletions

View File

@@ -30,8 +30,7 @@ impl FilterPlugin for SkipBytesFilter {
} }
// Copy the remaining data using io::copy for efficiency // Copy the remaining data using io::copy for efficiency
std::io::copy(reader, writer)?; std::io::copy(reader, writer)
Ok(())
} }
} }

View File

@@ -14,7 +14,6 @@ impl FilterPlugin for StripAnsiFilter {
fn filter<R: Read, W: Write>(&mut self, reader: &mut R, writer: &mut W) -> Result<()> { fn filter<R: Read, W: Write>(&mut self, reader: &mut R, writer: &mut W) -> Result<()> {
let mut ansi_writer = Writer::new(writer); let mut ansi_writer = Writer::new(writer);
std::io::copy(reader, &mut ansi_writer)?; std::io::copy(reader, &mut ansi_writer)?;
ansi_writer.flush()?; ansi_writer.flush()
Ok(())
} }
} }