fix: clone content for binary check closure

Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat>
This commit is contained in:
Andrew Phillips
2025-08-25 20:56:51 -03:00
parent 1fdb08b493
commit 41ff152a12

View File

@@ -79,6 +79,9 @@ impl AsyncItemService {
.await .await
.unwrap()?; .unwrap()?;
// Clone content for use in the binary check closure
let content_clone = content.clone();
// Get metadata to determine MIME type and binary status // Get metadata to determine MIME type and binary status
let (mime_type, is_binary) = { let (mime_type, is_binary) = {
let db = self.db.clone(); let db = self.db.clone();
@@ -96,7 +99,7 @@ impl AsyncItemService {
let is_binary = if let Some(binary_val) = metadata.get("binary") { let is_binary = if let Some(binary_val) = metadata.get("binary") {
binary_val == "true" binary_val == "true"
} else { } else {
crate::common::is_binary::is_binary(&content) crate::common::is_binary::is_binary(&content_clone)
}; };
Ok::<_, CoreError>((mime_type, is_binary)) Ok::<_, CoreError>((mime_type, is_binary))