feat: Implement clone_box for head, tail, and skip filters
Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat>
This commit is contained in:
@@ -32,6 +32,12 @@ impl FilterPlugin for HeadBytesFilter {
|
|||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn clone_box(&self) -> Box<dyn FilterPlugin> {
|
||||||
|
Box::new(Self {
|
||||||
|
remaining: self.remaining,
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct HeadLinesFilter {
|
pub struct HeadLinesFilter {
|
||||||
@@ -63,4 +69,10 @@ impl FilterPlugin for HeadLinesFilter {
|
|||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn clone_box(&self) -> Box<dyn FilterPlugin> {
|
||||||
|
Box::new(Self {
|
||||||
|
remaining: self.remaining,
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,6 +54,12 @@ impl FilterPlugin for SkipBytesFilter {
|
|||||||
std::io::copy(&mut *reader, &mut *writer)?;
|
std::io::copy(&mut *reader, &mut *writer)?;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn clone_box(&self) -> Box<dyn FilterPlugin> {
|
||||||
|
Box::new(Self {
|
||||||
|
remaining: self.remaining,
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct SkipLinesFilter {
|
pub struct SkipLinesFilter {
|
||||||
@@ -102,4 +108,10 @@ impl FilterPlugin for SkipLinesFilter {
|
|||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn clone_box(&self) -> Box<dyn FilterPlugin> {
|
||||||
|
Box::new(Self {
|
||||||
|
remaining: self.remaining,
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -61,6 +61,13 @@ impl FilterPlugin for TailBytesFilter {
|
|||||||
(&mut *writer).write_all(&result)?;
|
(&mut *writer).write_all(&result)?;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn clone_box(&self) -> Box<dyn FilterPlugin> {
|
||||||
|
Box::new(Self {
|
||||||
|
buffer: self.buffer.clone(),
|
||||||
|
count: self.count,
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct TailLinesFilter {
|
pub struct TailLinesFilter {
|
||||||
@@ -115,4 +122,11 @@ impl FilterPlugin for TailLinesFilter {
|
|||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn clone_box(&self) -> Box<dyn FilterPlugin> {
|
||||||
|
Box::new(Self {
|
||||||
|
lines: self.lines.clone(),
|
||||||
|
count: self.count,
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user