From 1a4e9d531a8ab8ca74a531758ac4b57d90931e04 Mon Sep 17 00:00:00 2001 From: Andrew Phillips Date: Fri, 29 Aug 2025 10:18:57 -0300 Subject: [PATCH] fix: make finish method public and fix ringbuf method names Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) --- src/filter_plugin/mod.rs | 2 +- src/filter_plugin/tail.rs | 4 ++-- src/services/item_service.rs | 16 ++++++++-------- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/filter_plugin/mod.rs b/src/filter_plugin/mod.rs index ba5b7d2..3cd71b3 100644 --- a/src/filter_plugin/mod.rs +++ b/src/filter_plugin/mod.rs @@ -41,7 +41,7 @@ impl FilterChain { Ok(current_data) } - fn finish(&mut self) -> Result> { + pub fn finish(&mut self) -> Result> { let mut result = Vec::new(); // Process each plugin's finish method and collect results diff --git a/src/filter_plugin/tail.rs b/src/filter_plugin/tail.rs index 117c373..3663a9f 100644 --- a/src/filter_plugin/tail.rs +++ b/src/filter_plugin/tail.rs @@ -68,7 +68,7 @@ impl FilterPlugin for TailLinesFilter { // Iterate backwards to find the starting point for i in (0..self.ring_buffer.len()).rev() { - let index = (self.ring_buffer.write_index() as isize - 1 - i as isize) + let index = (self.ring_buffer.write_pos() as isize - 1 - i as isize) .rem_euclid(self.ring_buffer.capacity() as isize) as usize; let byte = self.ring_buffer[index]; @@ -85,7 +85,7 @@ impl FilterPlugin for TailLinesFilter { let start_index = self.ring_buffer.len() - bytes_to_keep; let mut result = Vec::with_capacity(bytes_to_keep); for i in start_index..self.ring_buffer.len() { - let index = (self.ring_buffer.write_index() as isize - (self.ring_buffer.len() - i) as isize) + let index = (self.ring_buffer.write_pos() as isize - (self.ring_buffer.len() - i) as isize) .rem_euclid(self.ring_buffer.capacity() as isize) as usize; result.push(self.ring_buffer[index]); } diff --git a/src/services/item_service.rs b/src/services/item_service.rs index 4439dbf..aa2bd39 100644 --- a/src/services/item_service.rs +++ b/src/services/item_service.rs @@ -147,13 +147,13 @@ impl ItemService { conn: &Connection, id: i64, head_bytes: Option, - head_words: Option, + _head_words: Option, head_lines: Option, tail_bytes: Option, - tail_words: Option, + _tail_words: Option, tail_lines: Option, - line_start: Option, - line_end: Option, + _line_start: Option, + _line_end: Option, grep: Option, ) -> Result<(Vec, String, bool), CoreError> { // Use streaming approach to handle all filtering options consistently @@ -238,13 +238,13 @@ impl ItemService { conn: &Connection, id: i64, head_bytes: Option, - head_words: Option, + _head_words: Option, head_lines: Option, tail_bytes: Option, - tail_words: Option, + _tail_words: Option, tail_lines: Option, - line_start: Option, - line_end: Option, + _line_start: Option, + _line_end: Option, grep: Option, ) -> Result<(Box, String, bool), CoreError> { let item_with_meta = self.get_item(conn, id)?;