fix: resolve mutable borrow error in text plugin

Co-authored-by: aider (openai/andrew/openrouter/qwen/qwen3-coder) <aider@aider.chat>
This commit is contained in:
Andrew Phillips
2025-08-26 19:09:10 -03:00
parent 80c6573e71
commit 9f9e2749a9
2 changed files with 3 additions and 2 deletions

View File

@@ -216,7 +216,8 @@ impl MetaPlugin for TextMetaPlugin {
if self.is_binary_content == Some(false) && !self.buffer.is_empty() { if self.is_binary_content == Some(false) && !self.buffer.is_empty() {
// Count any remaining words/lines in the buffer if we haven't already // Count any remaining words/lines in the buffer if we haven't already
if self.word_count == 0 && self.line_count == 0 { if self.word_count == 0 && self.line_count == 0 {
self.count_text_stats(&self.buffer); let buffer_copy = self.buffer.clone();
self.count_text_stats(&buffer_copy);
} }
if let Some(meta_data) = crate::meta_plugin::process_metadata_outputs( if let Some(meta_data) = crate::meta_plugin::process_metadata_outputs(

View File

@@ -161,7 +161,7 @@ impl MetaService {
&self, &self,
conn: &Connection, conn: &Connection,
item_id: i64, item_id: i64,
plugin: &Box<dyn MetaPlugin>, _plugin: &Box<dyn MetaPlugin>,
response: crate::meta_plugin::MetaPluginResponse, response: crate::meta_plugin::MetaPluginResponse,
) { ) {
for meta_data in response.metadata { for meta_data in response.metadata {