fix: Implement Clone for FilterChain manually

Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat>
This commit is contained in:
Andrew Phillips
2025-09-03 07:48:00 -03:00
parent 2abdf5f2d9
commit 8c50af2246

View File

@@ -26,11 +26,20 @@ enum FilterType {
StripAnsi,
}
#[derive(Clone)]
pub struct FilterChain {
plugins: Vec<Box<dyn FilterPlugin>>,
}
impl Clone for FilterChain {
fn clone(&self) -> Self {
let mut plugins = Vec::with_capacity(self.plugins.len());
for plugin in &self.plugins {
plugins.push(plugin.clone_box());
}
FilterChain { plugins }
}
}
impl FilterChain {
pub fn new() -> Self {
Self {