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
|
// Copy the remaining data using io::copy for efficiency
|
||||||
std::io::copy(reader, writer)?;
|
std::io::copy(reader, writer)
|
||||||
Ok(())
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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(())
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user