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:
@@ -30,8 +30,7 @@ impl FilterPlugin for SkipBytesFilter {
|
||||
}
|
||||
|
||||
// Copy the remaining data using io::copy for efficiency
|
||||
std::io::copy(reader, writer)?;
|
||||
Ok(())
|
||||
std::io::copy(reader, writer)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -14,7 +14,6 @@ impl FilterPlugin for StripAnsiFilter {
|
||||
fn filter<R: Read, W: Write>(&mut self, reader: &mut R, writer: &mut W) -> Result<()> {
|
||||
let mut ansi_writer = Writer::new(writer);
|
||||
std::io::copy(reader, &mut ansi_writer)?;
|
||||
ansi_writer.flush()?;
|
||||
Ok(())
|
||||
ansi_writer.flush()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user